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 db/generate (nested command-dirs) help messages #555
Conversation
🤯 This might be my new favorite PR. All. Time. I'm so glad I complained about this while we were talking 😆 If you are able to take this one step further, all the commands need to be constrained for errors using either .strict() or .strictCommands(). You can see the history of Peter and I's attempts starting in this comment from PR #136 I think ideally this should be used one time at the top-level builder, No worries if you don't want to dig into this part. Just let me know and I'll pick up the work in #136 |
Be careful what you complain about--I might just fix it. 😅 And I started looking at that after throwing this one up. I ran into the generate commands error you mentioned in that thread. Definitely down to dig in here. |
Doing something like `yarn rw db seed --help` displays the help message for `yarn rw db` instead of `yarn rw db seed`. This fixes that.
@thedavidprice A top-level (index.js) This still might not be ideal for |
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.
This looks good to me!
@thedavidprice any reservations?
Nice! I'll take this for a test drive today and loop back. |
K, super loving this. Also, super rad unexpected behavior --> just yesterday I updated the app: {
choices: ['api', 'web'],
default: optionDefault(webExists, apiExists),
}, When the Yargs --help is run, I totally expected it to output $ yarn rw build --help
...
# in case of both directories existing
--app [choices: "api", "web"] [default: ["web","api"]]
# in case where only web/ exists
--app [choices: "api", "web"] [default: ["web"]] I just 😍when the details JustWork™ |
Closes #136 This one is working 💯. Merging now. |
Doing something like
yarn rw db seed --help
displays the help message foryarn rw db
instead ofyarn rw db seed
:Output for
yarn rw db help
Output for
yarn rw db seed --help
This fix correctly "scopes" help output for db (and generate):
New output for
yarn rw db seed --help
The fix
The fix was simply removing
.args
from the builder ofdb.js
andgenerate.js
: