refactoring, adding cli to edit config
This commit is contained in:
29
cmd/cli/main.go
Normal file
29
cmd/cli/main.go
Normal 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)))
|
||||
}
|
||||
Reference in New Issue
Block a user