You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining a boolean argument (e.g. --arg) that is enabled by default we currently print --no-arg usage.
I have some suggestions on this:
Only print --no-arg usage if negativeDescription is defined
While making changes to nuxt/cli I found it confusing that --no-arg is printed while the description described what happens if true is passed.
This can be made more explicit by only printing the --no-arg when a negativeDescription is defined, I realize this property was a later addition.
Always print both --arg and --no-arg
Printing both the normal usage and the negative usage (perhaps indented/nested) communicates to the end user that this is the same argument, it will be easier to find in the source code as well.
Only print aliases for the defined command (no negative aliases)
Not sure if intentional but the printed usage also applies the negative prefixes to defined aliases, this can look odd if an alias is a single character (e.g. -p, --production becomes --no-p, --no-production).
Personally I view the negative arguments as a kind of alias already, having negative versions of the aliases seems to go beyond convenience.
Removed last point, should be separate issue (out of scope for this issue)
Maybe the current behavior is as intended/desired, let me know! If not, I would be happy to help make implement the suggestions.
Additional information
Would you be willing to help implement this feature?
The text was updated successfully, but these errors were encountered:
Describe the feature
When defining a boolean argument (e.g.
--arg
) that is enabled by default we currently print--no-arg
usage.I have some suggestions on this:
Only print
--no-arg
usage ifnegativeDescription
is definedWhile making changes to
nuxt/cli
I found it confusing that--no-arg
is printed while thedescription
described what happens iftrue
is passed.This can be made more explicit by only printing the
--no-arg
when anegativeDescription
is defined, I realize this property was a later addition.Always print both
--arg
and--no-arg
Printing both the normal usage and the negative usage (perhaps indented/nested) communicates to the end user that this is the same argument, it will be easier to find in the source code as well.
Only print aliases for the defined command (no negative aliases)Not sure if intentional but the printed usage also applies the negative prefixes to defined aliases, this can look odd if an alias is a single character (e.g.-p, --production
becomes--no-p, --no-production
).Personally I view the negative arguments as a kind of alias already, having negative versions of the aliases seems to go beyond convenience.Removed last point, should be separate issue (out of scope for this issue)
Maybe the current behavior is as intended/desired, let me know! If not, I would be happy to help make implement the suggestions.
Additional information
The text was updated successfully, but these errors were encountered: