first alpha version cli

This commit is contained in:
2025-05-10 21:52:52 +02:00
parent f791b7085c
commit 2380a36271
8 changed files with 275 additions and 12 deletions

View File

@@ -17,19 +17,19 @@ type (
}
)
func (AddCmd) Name() string { return "add" }
func (AddCmd) Synopsis() string { return "Add a folder to the sync list" }
func (AddCmd) Usage() string {
func (*AddCmd) Name() string { return "add" }
func (*AddCmd) Synopsis() string { return "Add a folder to the sync list" }
func (*AddCmd) Usage() string {
return `add:
Add a folder to the sync list
`
}
func (p AddCmd) SetFlags(f *flag.FlagSet) {
func (p *AddCmd) SetFlags(f *flag.FlagSet) {
f.StringVar(&p.name, "name", "", "Override the name of the game")
}
func (p AddCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
func (p *AddCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
if f.NArg() != 1 {
fmt.Fprintln(os.Stderr, "error: the command is expecting for 1 argument")
return subcommands.ExitUsageError