{"record":{"id":"6b9150b358545d2a","repo":"kovidgoyal/kitty","slug":"no-arguments-allowed","errorCode":null,"errorMessage":"no arguments allowed","messagePattern":"no arguments allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/desktop_ui/main.go","lineNumber":177,"sourceCode":"\t\t},\n\t})\n\tst.Add(cli.OptionSpec{\n\t\tName:    \"--namespace -n\",\n\t\tHelp:    \"The namespace in which to change the setting.\",\n\t\tDefault: PORTAL_APPEARANCE_NAMESPACE,\n\t})\n\tst.Add(cli.OptionSpec{\n\t\tName: \"--data-type\",\n\t\tHelp: \"The DBUS data type signature of the value. The default is to guess from the textual representation, see :link:`the glib docs <https://docs.gtk.org/glib/gvariant-text-format.html>` for details.\",\n\t})\n\n\tss := parent.AddSubCommand(&cli.Command{\n\t\tName:             \"show-settings\",\n\t\tShortDescription: \"Print the current values of the desktop settings\",\n\t\tRun: func(cmd *cli.Command, args []string) (rc int, err error) {\n\t\t\tif len(args) != 0 {\n\t\t\t\tcmd.ShowHelp()\n\t\t\t\treturn 1, fmt.Errorf(\"no arguments allowed\")\n\t\t\t}\n\t\t\topts := ShowSettingsOptions{}\n\t\t\terr = cmd.GetOptionValues(&opts)\n\t\t\tif err == nil {\n\t\t\t\terr = show_settings(&opts)\n\t\t\t}\n\t\t\treturn utils.IfElse(err == nil, 0, 1), err\n\t\t},\n\t})\n\tss.Add(cli.OptionSpec{\n\t\tName: \"--as-json\",\n\t\tHelp: \"Show the settings as JSON for machine consumption\",\n\t\tType: \"bool-set\",\n\t})\n\tss.Add(cli.OptionSpec{\n\t\tName: \"--in-namespace\",\n\t\tHelp: \"Show only settings in the specified names. Can be specified multiple times. When unspecified all namespaces are returned.\",\n\t\tType: \"list\",","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/desktop_ui/main.go#L159-L195","documentation":"`show-settings` takes no positional arguments; it only accepts options. Supplying any positional argument triggers help display plus this error.","triggerScenarios":"Running `kitten desktop-ui show-settings foo` or passing a namespace as a positional argument instead of using the namespace option.","commonSituations":"Users assuming the command takes a namespace positional arg instead of the `--namespace` option.","solutions":["Remove positional arguments and use the command's options (e.g. the namespace/JSON flags) instead","Check `kitten desktop-ui show-settings --help` for accepted options"],"exampleFix":"# before\nkitten desktop-ui show-settings org.freedesktop.appearance\n# after\nkitten desktop-ui show-settings --namespace=org.freedesktop.appearance","handlingStrategy":"validation","validationCode":"if len(positionalArgs) > 0 { /* use options instead */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read --help to learn which inputs are options vs positionals"],"tags":["cli","desktop-ui","kitty","argument-validation"],"backgroundTag":"cli-unexpected-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}