-
Notifications
You must be signed in to change notification settings - Fork 2
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 markdown reference generator #39
Conversation
src/bin/am/commands.rs
Outdated
SubCommands::System(args) => system::handle_command(args).await, | ||
Some(SubCommands::Start(args)) => start::handle_command(args).await, | ||
Some(SubCommands::System(args)) => system::handle_command(args).await, | ||
None => return Ok(()), |
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.
Is this possible to occur? Shouldn't we print the usage in this case?
src/bin/am/commands.rs
Outdated
@@ -8,7 +8,9 @@ pub mod system; | |||
#[command(author, version, about, long_about = None)] | |||
pub struct Application { | |||
#[command(subcommand)] | |||
pub command: SubCommands, | |||
pub command: Option<SubCommands>, | |||
#[clap(long, hide = true)] |
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.
maybe we can make this required_unless_present = "command"
or the other way around (command
is required unless markdown_help
is present)
https://docs.rs/clap/latest/clap/struct.Arg.html#method.required_unless_present
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 guess we can also make it a sub-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.
agree
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.
agree, making it a subcommand makes the most sense
This update adds a markdown reference generator to the CLI.