浏览代码

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 周之前
父节点
当前提交
efa75b847d
共有 1 个文件被更改,包括 7 次插入 和 1 次删除
  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,
 	}