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
Add FML command line to nimbus-cli #5784
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #5784 +/- ##
==========================================
- Coverage 37.13% 36.91% -0.22%
==========================================
Files 330 331 +1
Lines 33150 33051 -99
==========================================
- Hits 12309 12201 -108
- Misses 20841 20850 +9
☔ View full report in Codecov by Sentry. |
e5e8b52
to
3cc2024
Compare
3cc2024
to
939ec48
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.
Looks good! I've got a question but otherwise I don't really have any concerns.
I will say it took me a minute to realize that if I want to pass flags I have to add them after a --
despite the tip for it.
// We prepend the string `nimbus-cli fml` to the args to pass to FML | ||
// because the clap uses the 0th argument for help messages. | ||
let first = OsStr::new("nimbus-cli fml").to_os_string(); | ||
let mut cli_args = vec![&first]; | ||
|
||
// To make this a little more ergonomic, if the user has just typed | ||
// `nimbus-cli fml`, then we can help them a little bit. | ||
let help = OsStr::new("--help").to_os_string(); | ||
if args.is_empty() { | ||
cli_args.push(&help); | ||
} else { | ||
cli_args.extend(args); | ||
} |
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.
Can you explain this a bit more? Sorry I'm not following the comments well enough to fully understand.
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.
sure, I'll update the comment; however, let me try here:
clap
uses the zeroth argument in the command line in help and error messages, so the FML clap would report an error with a usage messagenimbus-cli fml generate [OPTIONS] <INPUT> <OUTPUT>
instead ofnimbus-fml generate [OPTIONS] <INPUT> <OUTPUT>
.- If the user types
nimbus-cli fml
, it would give a rather unfriendlynot implemented: Command not implemented
; if/when we change thenimbus-fml
cli to useclap derive
, as we do in the CLI, this would change. Until then, add the--help
flag to display the usage message.
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.
Ahhhh gotcha okay cool. Thanks!
939ec48
to
4ec178d
Compare
Fixes EXP-3772.
Pull Request checklist
[ci full]
to the PR title.Branch builds: add
[firefox-android: branch-name]
to the PR title.