-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(usage): tie usage to config #2908
Conversation
c4145cd
to
2c3c747
Compare
@@ -1311,6 +1313,34 @@ The program to use to view help content. | |||
|
|||
Set to `"browser"` to view html help content in the default web browser. | |||
|
|||
#### `which` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which
was not defined yet, and I re-ran the make to generate this file. We should think about automating this make command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's included in the make docs
that's part of the release process as a final safety net, but some easier way to run it ahead of time would be nice, too, I agree.
@@ -21,6 +21,8 @@ t.test('basic definition', async t => { | |||
default: 'some default value', | |||
defaultDescription: '"some default value"', | |||
type: [Number, String], | |||
hint: '<key>', | |||
usage: '--key <key>|--key <key>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can address this once we add a config item that has this kind of type to a command's params.
2c3c747
to
eab8246
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i love this. generated usage information based on the actual available options is a huge win. added bonus that we're now separating options that are available from usage information, which are indeed two separate concerns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this. A few suggestions and minor nitpicky fixups, but overall this is exactly the direction we should be going, yes.
@@ -1311,6 +1313,34 @@ The program to use to view help content. | |||
|
|||
Set to `"browser"` to view html help content in the default web browser. | |||
|
|||
#### `which` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's included in the make docs
that's part of the release process as a final safety net, but some easier way to run it ahead of time would be nice, too, I agree.
8a7855e
to
f37bb68
Compare
This starts us down the path of tying the params our commands accept to their config items. For now it is optional, and not every current config item would cleanly render if we added them today. The ones that are added here DO render nicely, and we can iterate from here. We can also at a later date do the same kind of appraoch with our positional args. PR-URL: #2908 Credit: @wraithgar Close: #2908 Reviewed-by: @nlf, @isaacs
f37bb68
to
b876442
Compare
This starts us down the path of tying the params our commands accept to
their config items. For now it is optional, and not every current
config item would cleanly render if we added them today.
The ones that are added here DO render nicely, and we can iterate from
here. We can also at a later date do the same kind of appraoch with our
positional args.
References
Related to npm/statusboard#308
Here we can see the brute-force "Just show a really long complicated usage string" approach for our current save-flag situation in use.
@scope
hint exampleShorthand examples
Example of using manual usage declaration in the config to show the
--no-
option instead