kovidgoyal/kitty · error

no arguments allowed

Error message

no arguments allowed

What it means

`show-settings` takes no positional arguments; it only accepts options. Supplying any positional argument triggers help display plus this error.

Source

Thrown at kittens/desktop_ui/main.go:177

		},
	})
	st.Add(cli.OptionSpec{
		Name:    "--namespace -n",
		Help:    "The namespace in which to change the setting.",
		Default: PORTAL_APPEARANCE_NAMESPACE,
	})
	st.Add(cli.OptionSpec{
		Name: "--data-type",
		Help: "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.",
	})

	ss := parent.AddSubCommand(&cli.Command{
		Name:             "show-settings",
		ShortDescription: "Print the current values of the desktop settings",
		Run: func(cmd *cli.Command, args []string) (rc int, err error) {
			if len(args) != 0 {
				cmd.ShowHelp()
				return 1, fmt.Errorf("no arguments allowed")
			}
			opts := ShowSettingsOptions{}
			err = cmd.GetOptionValues(&opts)
			if err == nil {
				err = show_settings(&opts)
			}
			return utils.IfElse(err == nil, 0, 1), err
		},
	})
	ss.Add(cli.OptionSpec{
		Name: "--as-json",
		Help: "Show the settings as JSON for machine consumption",
		Type: "bool-set",
	})
	ss.Add(cli.OptionSpec{
		Name: "--in-namespace",
		Help: "Show only settings in the specified names. Can be specified multiple times. When unspecified all namespaces are returned.",
		Type: "list",

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Remove positional arguments and use the command's options (e.g. the namespace/JSON flags) instead
  2. Check `kitten desktop-ui show-settings --help` for accepted options

Example fix

# before
kitten desktop-ui show-settings org.freedesktop.appearance
# after
kitten desktop-ui show-settings --namespace=org.freedesktop.appearance
Defensive patterns

Strategy: validation

Validate before calling

if len(positionalArgs) > 0 { /* use options instead */ }

Prevention

When it happens

Trigger: Running `kitten desktop-ui show-settings foo` or passing a namespace as a positional argument instead of using the namespace option.

Common situations: Users assuming the command takes a namespace positional arg instead of the `--namespace` option.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/6b9150b358545d2a. Report an issue: GitHub.