argh
argh copied to clipboard
Rust derive-based argument parsing optimized for code size
```rust #[derive(argh::FromArgs)] #[argh(description = env!("GIT_HASH"))] struct Args {} ``` ``` error: expected literal --> arghdesc.rs:2:22 | 2 | #[argh(description = env!("GIT_HASH"))] | ^^^ error: #[derive(FromArgs)] type with no description. Add...
Current the function is defined as: ```rust fn from_args(command_name: &[&str], args: &[&str]) -> Result; ``` This could be changed to: ```rust fn from_args(command_name: &[T], args: &[U]) -> Result where T:...
My project has a use case for negative switch flags. E.g: --action // Sets args.action to true --noaction // Sets args.action to false Yes, we could add the two flags...
how skip a field like #[serde(skip)]
Hi! I've added a few features related to help and error reporting: 1. a new ‘help_text’ attribute that denotes a pseudo-argument containing the generated help – it comes handy if...
Fixes #191 This implementation prioritises recognized flags over positional arguments in the case of ambiguity. Edit: CLA signed.
Because of https://github.com/google/argh/blob/f02f6b44444b340a553ff2db298744721ebc77a7/argh/src/lib.rs#L923 positional arguments that start with a `-` get misinterpreted as optionals. This prevents e.g. taking numbers or filenames that start with a dash as required arguments, despite...