Files
cloudsave/cmd/cli/main.go
2025-07-29 17:34:27 +02:00

39 lines
1.0 KiB
Go

package main
import (
"cloudsave/cmd/cli/commands/add"
"cloudsave/cmd/cli/commands/list"
"cloudsave/cmd/cli/commands/pull"
"cloudsave/cmd/cli/commands/remote"
"cloudsave/cmd/cli/commands/remove"
"cloudsave/cmd/cli/commands/run"
"cloudsave/cmd/cli/commands/sync"
"cloudsave/cmd/cli/commands/version"
"context"
"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(&run.RunCmd{}, "management")
subcommands.Register(&list.ListCmd{}, "management")
subcommands.Register(&remove.RemoveCmd{}, "management")
subcommands.Register(&remote.RemoteCmd{}, "remote")
subcommands.Register(&sync.SyncCmd{}, "remote")
subcommands.Register(&pull.PullCmd{}, "remote")
flag.Parse()
ctx := context.Background()
os.Exit(int(subcommands.Execute(ctx)))
}