refactoring, adding cli to edit config

This commit is contained in:
2025-08-26 21:59:50 +02:00
parent e36b15e271
commit 2c109b945e
14 changed files with 503 additions and 20 deletions

29
cmd/cli/main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"context"
"downloadhub/cmd/cli/commands/add"
"downloadhub/cmd/cli/commands/edit"
"downloadhub/cmd/cli/commands/link"
"downloadhub/cmd/cli/commands/version"
"flag"
"os"
"github.com/google/subcommands"
)
func main() {
subcommands.Register(subcommands.HelpCommand(), "help")
subcommands.Register(subcommands.FlagsCommand(), "help")
subcommands.Register(subcommands.CommandsCommand(), "help")
subcommands.Register(&version.VersionCmd{}, "help")
subcommands.Register(&add.AddCmd{}, "management")
subcommands.Register(&edit.EditCmd{}, "management")
subcommands.Register(&link.LinkCmd{}, "management")
flag.Parse()
ctx := context.Background()
os.Exit(int(subcommands.Execute(ctx)))
}