kovidgoyal/kitty

Clarification difference between `show_key` and `show-key`

nobe4 opened this issue ยท 2 comments

nobe4 commented

Hi ๐Ÿ‘‹

It seems that the doc references two ways to show the keys:

Both seems to work, and to offer the same functionalities, however the name differences makes it confusing which one should really be used.

It seems that both are valid kittens:

$ kitten show-keys
Error: Unknown subcommand: show-keys. Did you mean:
	show-key
	show_key

kitty/tools/cli/option.go

Lines 103 to 105 in e7c4069

func NormalizeOptionName(name string) string {
return strings.ReplaceAll(strings.TrimLeft(name, "-"), "_", "-")
}
seems to be giving the option to use both.

Seems that it's the same for all kittens:

$ kitten hyperlinked-greps
Error: Unknown subcommand: hyperlinked-greps. Did you mean:
	hyperlinked-grep
	hyperlinked_grep

Probably the docs should explicit that both work?

Maybe a line in

root.HelpText = "kitten serves as a launcher for running individual kittens. Each kitten can be run as :code:`kitten command`. The list of available kittens is given below."
would be enough to clarify this?

I don't know the reason to have this conversion on command names, but it confused me to see both in the docs.

Happy to PR an improvement if you think one make sense :)

Both work so users dont need to remember which one it is. The docs
should all use the hyphen rather than the underscore. Feel free to send
a PR fixing the docs.

nobe4 commented

Thanks! Done in #7404