Repository navigation
Offer ability to short circuit help output (Ex: -h) #30
Description
Activity
Alternatively, to let the programmer decide (because maybe they want to use
-hfor something else),
there should be a way to manually call the function that prints the usage information (that's called when--helpis passed).
So that it can be manually called when-his passed with an explicit#[argh(switch, short = 'h')] help: boolfield.I.e. this function:
Line 22 in c752b5f
pub(crate) fn help( But wrapped in a nicer way, callable as a method on the struct that
FromArgsis derived on.Reacted by Benjamin Brittain and Geobert QuachI'd be far more amicable to that change! That seems like a good option for those that want
-hsupportReacted by Boscop- addedbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
on Jul 10, 2020 - changed the title
[-]Arg -h should work the same as --help[/-][+]Offer ability to short circuit help output[/+]on Jul 10, 2020 - changed the title
[-]Offer ability to short circuit help output[/-][+]Offer ability to short circuit help output (Ex: -h)[/+]on Jul 10, 2020 I'd also like to see an
-hshorthand flag, and I'd be willing to create a PR. However, I am concerned that letting the user implement the shorthand and argh worry about the long flag, the help would end up looking something like that:Options: -h display usage information --help display usage informationTherefore, I think either the user should be given the option to specify a shorthand for the help message, or be able to "replace" the help switch altogether. Let me know what you think.
Reacted by Denys Séguret and pepa65oh interesting, yes that makes sense. I'm open to a change like that!
Agreed on the
-hshorthand flag. As for anything else, I don't want programmers to decide that-hshould mean anything else, I want it to just be always a shorthand for--help.Reacted by Boscop, msrd0 and pepa65I made a pull request that fixes this issue #106
Reacted by icefoxen
Currently, passing
-hdoesn't work:Passing
-hshould work the same as--help, unless one of the options/switches usesshort = 'h'.And in the Usage output, it would then show
instead of just