Browse Source

name `generate` in the one line that is all a reader gets

`keyboard definitions generate` is two levels down, and cobra does not
list a subcommand under a parent that has a RunE of its own, so from
`keyboard --help` the only thing offered was "List the definition files".
Asking where generate was is the discoverability failure in miniature.
Paul-Dieter Klumpp 1 tuần trước cách đây
mục cha
commit
efa75b847d
1 tập tin đã thay đổi với 7 bổ sung và 1 xóa
  1. 7 1
      cmd/qmk-rgb-tool/definition.go

+ 7 - 1
cmd/qmk-rgb-tool/definition.go

@@ -61,10 +61,16 @@ func NewKeyboardFetchCmd() *cobra.Command {
 // rather than a verb on purpose. `keyboard list` reads as listing the
 // keyboards, which is what `keyboard info` does, and the root already has a
 // `list` that means the profile store; one verb must not mean two stores.
+//
+// The Short names what the command can do beyond listing, because `generate` is
+// two levels down and cobra does not list a subcommand under a parent that runs
+// itself: from `keyboard --help` this line is all there is, and a reader who
+// finds out by running `generate` and getting an arity error has not been told
+// anything.
 func NewKeyboardDefinitionsCmd() *cobra.Command {
 	return &cobra.Command{
 		Use:   "definitions",
-		Short: "List the definition files in the data directory, and those built in",
+		Short: "List the definition files in the data directory, and those built in; also writes one, with `generate`",
 		Args:  cobra.NoArgs,
 		RunE:  runKeyboardDefinitions,
 	}