| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| README.md | D | 03-May-2024 | 1.9 KiB | 87 | 44 | |
| after_help.rs | D | 03-May-2024 | 950 | 44 | 11 | |
| at_least_two.rs | D | 03-May-2024 | 701 | 31 | 10 | |
| basic.rs | D | 03-May-2024 | 2 KiB | 73 | 24 | |
| deny_missing_docs.rs | D | 03-May-2024 | 1.7 KiB | 72 | 26 | |
| doc_comments.rs | D | 03-May-2024 | 4.2 KiB | 125 | 32 | |
| enum_in_args.rs | D | 03-May-2024 | 865 | 41 | 19 | |
| enum_in_args_with_strum.rs | D | 03-May-2024 | 982 | 43 | 23 | |
| enum_tuple.rs | D | 03-May-2024 | 971 | 43 | 20 | |
| env.rs | D | 03-May-2024 | 1.3 KiB | 44 | 13 | |
| example.rs | D | 03-May-2024 | 2.4 KiB | 78 | 22 | |
| flatten.rs | D | 03-May-2024 | 999 | 47 | 19 | |
| gen_completions.rs | D | 03-May-2024 | 1.2 KiB | 41 | 12 | |
| git.rs | D | 03-May-2024 | 1.4 KiB | 54 | 25 | |
| group.rs | D | 03-May-2024 | 1.3 KiB | 52 | 21 | |
| keyvalue.rs | D | 03-May-2024 | 1.4 KiB | 52 | 23 | |
| negative_flag.rs | D | 03-May-2024 | 718 | 29 | 10 | |
| no_version.rs | D | 03-May-2024 | 614 | 29 | 13 | |
| rename_all.rs | D | 03-May-2024 | 3.3 KiB | 96 | 31 | |
| required_if.rs | D | 03-May-2024 | 1.6 KiB | 63 | 34 | |
| skip.rs | D | 03-May-2024 | 843 | 48 | 39 | |
| subcommand_aliases.rs | D | 03-May-2024 | 1 KiB | 39 | 14 | |
| true_or_false.rs | D | 03-May-2024 | 1.1 KiB | 42 | 28 |
README.md
1# Collection of examples "how to use `structopt`" 2 3### [Help on the bottom](after_help.rs) 4 5How to append a postscript to the help message generated. 6 7### [At least N](at_least_two.rs) 8 9How to require presence of at least N values, like `val1 val2 ... valN ... valM`. 10 11### [Basic](basic.rs) 12 13A basic example how to use `structopt`. 14 15### [Deny missing docs](deny_missing_docs.rs) 16 17**This is not an example but a test**, it should be moved to `tests` folder 18as soon as [this](https://github.com/rust-lang/rust/issues/24584) is fixed (if ever). 19 20### [Doc comments](doc_comments.rs) 21 22How to use doc comments in place of `help/long_help`. 23 24### [Enums as arguments](enum_in_args.rs) 25 26How to use `arg_enum!` with `StructOpt`. 27 28### [Arguments of subcommands in separate `struct`](enum_tuple.rs) 29 30How to extract subcommands' args into external structs. 31 32### [Environment variables](env.rs) 33 34How to use environment variable fallback and how it interacts with `default_value`. 35 36### [Advanced](example.rs) 37 38Somewhat complex example of usage of `structopt`. 39 40### [Flatten](flatten.rs) 41 42How to use `#[structopt(flatten)]` 43 44### [`bash` completions](gen_completions.rs) 45 46Generating `bash` completions with `structopt`. 47 48### [Git](git.rs) 49 50Pseudo-`git` example, shows how to use subcommands and how to document them. 51 52### [Groups](group.rs) 53 54Using `clap::Arg::group` with `structopt`. 55 56### [`key=value` pairs](keyvalue.rs) 57 58How to parse `key=value` pairs. 59 60### [`--no-*` flags](negative_flag.rs) 61 62How to add `no-thing` flag which is `true` by default and `false` if passed. 63 64### [No version](no_version.rs) 65 66How to completely remove version. 67 68### [Rename all](rename_all.rs) 69 70How `#[structopt(rename_all)]` works. 71 72### [Required If](required_if.rs) 73 74How to use `#[structopt(required_if)]`. 75 76### [Skip](skip.rs) 77 78How to use `#[structopt(skip)]`. 79 80### [Aliases](subcommand_aliases.rs) 81 82How to use aliases 83 84### [`true` or `false`](true_or_false.rs) 85 86How to express "`"true"` or `"false"` argument. 87