{"record":{"id":"d516c674a9ada844","repo":"kovidgoyal/kitty","slug":"no-command-line-arguments-are-allowed","errorCode":null,"errorMessage":"No command line arguments are allowed","messagePattern":"No command line arguments are allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/cmd/update_self/main.go","lineNumber":79,"sourceCode":"\t} else {\n\t\terr = tui.DownloadFileWithProgress(exe, url, true)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfmt.Print(\"Updated to: \")\n\treturn unix.Exec(exe, []string{\"kitten\", \"--version\"}, os.Environ())\n}\n\nfunc EntryPoint(root *cli.Command) *cli.Command {\n\tsc := root.AddSubCommand(&cli.Command{\n\t\tName:             \"update-self\",\n\t\tUsage:            \"[options]\",\n\t\tShortDescription: \"Update this kitten binary\",\n\t\tHelpText:         \"Update this kitten binary in place to the latest available version.\",\n\t\tRun: func(cmd *cli.Command, args []string) (ret int, err error) {\n\t\t\tif len(args) != 0 {\n\t\t\t\treturn 1, fmt.Errorf(\"No command line arguments are allowed\")\n\t\t\t}\n\t\t\topts := &Options{}\n\t\t\terr = cmd.GetOptionValues(opts)\n\t\t\tif err != nil {\n\t\t\t\treturn 1, err\n\t\t\t}\n\t\t\treturn 0, update_self(opts.FetchVersion)\n\t\t},\n\t})\n\tsc.Add(cli.OptionSpec{\n\t\tName:    \"--fetch-version\",\n\t\tDefault: \"latest\",\n\t\tHelp:    fmt.Sprintf(\"The version to fetch. The special words :code:`latest` and :code:`nightly` fetch the latest stable and nightly release respectively. Other values can be, for example: :code:`%s`.\", kitty.VersionString),\n\t})\n\treturn sc\n}\n","sourceCodeStart":61,"sourceCodeEnd":96,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/cmd/update_self/main.go#L61-L96","documentation":"The update-self kitten command refuses any positional command line arguments; it only accepts options. The Run function checks len(args) != 0 and fails immediately with exit code 1.","triggerScenarios":"Running kitten's update-self subcommand with any trailing argument, e.g. `kitten update-self foo` or passing a version string positionally instead of via an option flag.","commonSituations":"Users assuming the command takes a target version argument, or shell scripts appending stray arguments/flags after an unquoted variable that expands to multiple words.","solutions":["Remove all positional arguments from the update-self command line","If you meant to pass a version or channel, check `kitten update-self --help` for the supported options and use flag syntax","Quote shell variables used in the command to prevent word-splitting into extra args"],"exampleFix":"# before\nkitten update-self v0.35.0\n# after\nkitten update-self","handlingStrategy":"validation","validationCode":"args := cmd.Args().Slice()\nif len(args) != 0 {\n    fmt.Fprintf(os.Stderr, \"update-self takes no positional arguments\\n\")\n    return 1\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invoke update-self with options only","Quote shell variables in wrapper scripts to avoid word splitting"],"tags":["cli","arguments","kitty","update"],"backgroundTag":"cli-unexpected-arguments","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}