Comments (6)
Alternatively, to let the programmer decide (because maybe they want to use -h
for something else),
there should be a way to manually call the function that prints the usage information (that's called when --help
is passed).
So that it can be manually called when -h
is passed with an explicit #[argh(switch, short = 'h')] help: bool
field.
I.e. this function:
Line 22 in c752b5f
But wrapped in a nicer way, callable as a method on the struct that FromArgs
is derived on.
from argh.
Agreed on the -h
shorthand flag. As for anything else, I don't want programmers to decide that -h
should mean anything else, I want it to just be always a shorthand for --help
.
from argh.
I'd be far more amicable to that change! That seems like a good option for those that want -h
support
from argh.
I'd also like to see an -h
shorthand 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 information
Therefore, 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.
from argh.
I made a pull request that fixes this issue #106
from argh.
oh interesting, yes that makes sense. I'm open to a change like that!
from argh.
Related Issues (20)
- add an attribute on option argument to let `from_str_fn` can return `Vec<T>` or `Option<T>` as-is HOT 7
- how skip a field like #[serde(skip)] HOT 2
- Is it possible to get a `TopLevelCommand`'s `FieldAttrs` with the current exposed API?
- positional arguments made on field with reserved named (ref_) keep the trailing _ in help text
- Negative switches
- Subcommand with no additional arguments? HOT 1
- Impossible to include angle brackets in help text in a way that satisfies argh and rustdoc
- Change `FromArgs::from_args` to accept `AsRef<str>`
- Support something like --helpfull which displays help for all subcommands HOT 2
- `#[argh(description = "...")]` only supports literal HOT 3
- Single dash is parsed as unrecognized argument HOT 1
- Disable automatically generated help message
- mutual exclusive options/switches
- don't work as a cargo-subcommand
- Any ability to specify 'raw' greedy args or pass-through?
- Consider making serde dependency optional (as a feature) HOT 1
- Inconsistent help-related behavior around subcommands
- Document `arg_name` attribute
- Unhelpfully-aimed error-messages on subcommands
- Positional arguments fail with negative numbers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argh.