to provide a command") return } command := args[0] switch command { case "list": // ... break case "new": newCommand := flag.NewFlagSet("new", flag.ExitOnError) text := newCommand.String("text", "", "text for new todo") newCommand.Parse(args[1:]) // ... break case "complete": completeCommand := flag.NewFlagSet("complete", flag.ExitOnError) id := completeCommand.Int("id", 0, "id to complete") completeCommand.Parse(args[1:]) // ... break }