summaryrefslogtreecommitdiffstats
path: root/vendor/clap
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/clap-3.2.20/.cargo-checksum.json1
-rw-r--r--vendor/clap-3.2.20/Cargo.lock746
-rw-r--r--vendor/clap-3.2.20/Cargo.toml471
-rw-r--r--vendor/clap-3.2.20/LICENSE-APACHE (renamed from vendor/annotate-snippets-0.8.0/LICENSE-APACHE)0
-rw-r--r--vendor/clap-3.2.20/LICENSE-MIT21
-rw-r--r--vendor/clap-3.2.20/README.md43
-rw-r--r--vendor/clap-3.2.20/examples/cargo-example-derive.md (renamed from vendor/clap/examples/cargo-example-derive.md)2
-rw-r--r--vendor/clap-3.2.20/examples/cargo-example-derive.rs (renamed from vendor/clap/examples/cargo-example-derive.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/cargo-example.md (renamed from vendor/clap/examples/cargo-example.md)2
-rw-r--r--vendor/clap-3.2.20/examples/cargo-example.rs (renamed from vendor/clap/examples/cargo-example.rs)2
-rw-r--r--vendor/clap-3.2.20/examples/demo.md (renamed from vendor/clap/examples/demo.md)9
-rw-r--r--vendor/clap-3.2.20/examples/demo.rs (renamed from vendor/clap/examples/demo.rs)2
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/augment_args.rs27
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/augment_subcommands.rs (renamed from vendor/clap/examples/derive_ref/augment_subcommands.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/custom-bool.md (renamed from vendor/clap/examples/derive_ref/custom-bool.md)0
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/custom-bool.rs (renamed from vendor/clap/examples/derive_ref/custom-bool.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/flatten_hand_args.rs (renamed from vendor/clap/examples/derive_ref/flatten_hand_args.rs)8
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/hand_subcommand.rs (renamed from vendor/clap/examples/derive_ref/hand_subcommand.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/derive_ref/interop_tests.md (renamed from vendor/clap/examples/derive_ref/interop_tests.md)0
-rw-r--r--vendor/clap-3.2.20/examples/escaped-positional-derive.md (renamed from vendor/clap/examples/escaped-positional-derive.md)4
-rw-r--r--vendor/clap-3.2.20/examples/escaped-positional-derive.rs (renamed from vendor/clap/examples/escaped-positional-derive.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/escaped-positional.md (renamed from vendor/clap/examples/escaped-positional.md)4
-rw-r--r--vendor/clap-3.2.20/examples/escaped-positional.rs (renamed from vendor/clap/examples/escaped-positional.rs)9
-rw-r--r--vendor/clap-3.2.20/examples/git-derive.md (renamed from vendor/clap/examples/git-derive.md)4
-rw-r--r--vendor/clap-3.2.20/examples/git-derive.rs (renamed from vendor/clap/examples/git-derive.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/git.md (renamed from vendor/clap/examples/git.md)2
-rw-r--r--vendor/clap-3.2.20/examples/git.rs101
-rw-r--r--vendor/clap-3.2.20/examples/multicall-busybox.md (renamed from vendor/clap/examples/multicall-busybox.md)6
-rw-r--r--vendor/clap-3.2.20/examples/multicall-busybox.rs (renamed from vendor/clap/examples/multicall-busybox.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/multicall-hostname.md10
-rw-r--r--vendor/clap-3.2.20/examples/multicall-hostname.rs (renamed from vendor/clap/examples/multicall-hostname.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/pacman.md (renamed from vendor/clap/examples/pacman.md)2
-rw-r--r--vendor/clap-3.2.20/examples/pacman.rs111
-rw-r--r--vendor/clap-3.2.20/examples/repl.rs (renamed from vendor/clap/examples/repl.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/01_quick.md37
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/01_quick.rs (renamed from vendor/clap/examples/tutorial_builder/01_quick.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.md19
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.rs (renamed from vendor/clap/examples/tutorial_builder/02_app_settings.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/02_apps.md19
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/02_apps.rs (renamed from vendor/clap/examples/tutorial_builder/02_apps.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/02_crate.md18
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/02_crate.rs18
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.md23
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.rs14
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.md23
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.rs9
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.md32
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.rs9
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.md22
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.rs9
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.md64
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.rs (renamed from vendor/clap/examples/tutorial_builder/03_04_subcommands.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.md22
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.rs (renamed from vendor/clap/examples/tutorial_builder/03_05_default_values.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.md29
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.rs66
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.md29
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.rs (renamed from vendor/clap/examples/tutorial_builder/04_01_possible.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.md31
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.rs (renamed from vendor/clap/examples/tutorial_builder/04_02_parse.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.md31
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.rs (renamed from vendor/clap/examples/tutorial_builder/04_02_validate.rs)4
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.md58
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.rs80
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.md57
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.rs (renamed from vendor/clap/examples/tutorial_builder/04_04_custom.rs)15
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_builder/05_01_assert.rs25
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/01_quick.md37
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/01_quick.rs (renamed from vendor/clap/examples/tutorial_derive/01_quick.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.md19
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.rs (renamed from vendor/clap/examples/tutorial_derive/02_app_settings.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_apps.md19
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_apps.rs (renamed from vendor/clap/examples/tutorial_derive/02_apps.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_crate.md18
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs17
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.md23
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.rs (renamed from vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.md23
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.rs (renamed from vendor/clap/examples/tutorial_derive/03_01_flag_count.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.md32
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.rs (renamed from vendor/clap/examples/tutorial_derive/03_02_option.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.md22
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.rs (renamed from vendor/clap/examples/tutorial_derive/03_03_positional.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.md64
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.rs (renamed from vendor/clap/examples/tutorial_derive/03_04_subcommands.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands_alt.rs (renamed from vendor/clap/examples/tutorial_derive/03_04_subcommands_alt.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.md22
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.rs (renamed from vendor/clap/examples/tutorial_derive/03_05_default_values.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.md29
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.rs28
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.md31
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.rs (renamed from vendor/clap/examples/tutorial_derive/04_02_parse.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.md31
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.rs (renamed from vendor/clap/examples/tutorial_derive/04_02_validate.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.md58
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.rs72
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.md57
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.rs (renamed from vendor/clap/examples/tutorial_derive/04_04_custom.rs)0
-rw-r--r--vendor/clap-3.2.20/examples/tutorial_derive/05_01_assert.rs21
-rw-r--r--vendor/clap-3.2.20/examples/typed-derive.md (renamed from vendor/clap/examples/typed-derive.md)4
-rw-r--r--vendor/clap-3.2.20/examples/typed-derive.rs (renamed from vendor/clap/examples/typed-derive.rs)4
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/cargo_example.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/cargo_example_derive0
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/cargo_example_derive.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/escaped_positional.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/escaped_positional_derive.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/git.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/git_derive.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/mod.rs55
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/multicall_busybox.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/multicall_hostname.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/pacman.rs7
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/repl.rs5
-rw-r--r--vendor/clap-3.2.20/src/_cookbook/typed_derive.rs7
-rw-r--r--vendor/clap-3.2.20/src/_derive/_tutorial.rs205
-rw-r--r--vendor/clap-3.2.20/src/_derive/mod.rs510
-rw-r--r--vendor/clap-3.2.20/src/_faq.rs95
-rw-r--r--vendor/clap-3.2.20/src/_features.rs27
-rw-r--r--vendor/clap-3.2.20/src/_tutorial.rs204
-rw-r--r--vendor/clap-3.2.20/src/bin/stdio-fixture.rs (renamed from vendor/clap/src/bin/stdio-fixture.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/action.rs (renamed from vendor/clap/src/builder/action.rs)8
-rw-r--r--vendor/clap-3.2.20/src/builder/app_settings.rs (renamed from vendor/clap/src/builder/app_settings.rs)32
-rw-r--r--vendor/clap-3.2.20/src/builder/arg.rs (renamed from vendor/clap/src/builder/arg.rs)20
-rw-r--r--vendor/clap-3.2.20/src/builder/arg_group.rs (renamed from vendor/clap/src/builder/arg_group.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/arg_predicate.rs (renamed from vendor/clap/src/builder/arg_predicate.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/arg_settings.rs (renamed from vendor/clap/src/builder/arg_settings.rs)27
-rw-r--r--vendor/clap-3.2.20/src/builder/command.rs (renamed from vendor/clap/src/builder/command.rs)106
-rw-r--r--vendor/clap-3.2.20/src/builder/debug_asserts.rs (renamed from vendor/clap/src/builder/debug_asserts.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/macros.rs (renamed from vendor/clap/src/builder/macros.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/mod.rs (renamed from vendor/clap/src/builder/mod.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/possible_value.rs (renamed from vendor/clap/src/builder/possible_value.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/regex.rs (renamed from vendor/clap/src/builder/regex.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/tests.rs (renamed from vendor/clap/src/builder/tests.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/usage_parser.rs (renamed from vendor/clap/src/builder/usage_parser.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/value_hint.rs (renamed from vendor/clap/src/builder/value_hint.rs)0
-rw-r--r--vendor/clap-3.2.20/src/builder/value_parser.rs (renamed from vendor/clap/src/builder/value_parser.rs)2
-rw-r--r--vendor/clap-3.2.20/src/derive.rs (renamed from vendor/clap/src/derive.rs)28
-rw-r--r--vendor/clap-3.2.20/src/error/context.rs (renamed from vendor/clap/src/error/context.rs)0
-rw-r--r--vendor/clap-3.2.20/src/error/kind.rs440
-rw-r--r--vendor/clap-3.2.20/src/error/mod.rs1153
-rw-r--r--vendor/clap-3.2.20/src/lib.rs232
-rw-r--r--vendor/clap-3.2.20/src/macros.rs1058
-rw-r--r--vendor/clap-3.2.20/src/mkeymap.rs (renamed from vendor/clap/src/mkeymap.rs)0
-rw-r--r--vendor/clap-3.2.20/src/output/fmt.rs (renamed from vendor/clap/src/output/fmt.rs)0
-rw-r--r--vendor/clap-3.2.20/src/output/help.rs (renamed from vendor/clap/src/output/help.rs)0
-rw-r--r--vendor/clap-3.2.20/src/output/mod.rs (renamed from vendor/clap/src/output/mod.rs)0
-rw-r--r--vendor/clap-3.2.20/src/output/usage.rs (renamed from vendor/clap/src/output/usage.rs)117
-rw-r--r--vendor/clap-3.2.20/src/parser/arg_matcher.rs (renamed from vendor/clap/src/parser/arg_matcher.rs)4
-rw-r--r--vendor/clap-3.2.20/src/parser/error.rs67
-rw-r--r--vendor/clap-3.2.20/src/parser/features/mod.rs (renamed from vendor/clap/src/parser/features/mod.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/features/suggestions.rs (renamed from vendor/clap/src/parser/features/suggestions.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/matches/any_value.rs (renamed from vendor/clap/src/parser/matches/any_value.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/matches/arg_matches.rs (renamed from vendor/clap/src/parser/matches/arg_matches.rs)74
-rw-r--r--vendor/clap-3.2.20/src/parser/matches/matched_arg.rs (renamed from vendor/clap/src/parser/matches/matched_arg.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/matches/mod.rs (renamed from vendor/clap/src/parser/matches/mod.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/matches/value_source.rs (renamed from vendor/clap/src/parser/matches/value_source.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/mod.rs (renamed from vendor/clap/src/parser/mod.rs)0
-rw-r--r--vendor/clap-3.2.20/src/parser/parser.rs (renamed from vendor/clap/src/parser/parser.rs)148
-rw-r--r--vendor/clap-3.2.20/src/parser/validator.rs (renamed from vendor/clap/src/parser/validator.rs)0
-rw-r--r--vendor/clap-3.2.20/src/util/color.rs (renamed from vendor/clap/src/util/color.rs)0
-rw-r--r--vendor/clap-3.2.20/src/util/fnv.rs (renamed from vendor/clap/src/util/fnv.rs)0
-rw-r--r--vendor/clap-3.2.20/src/util/graph.rs (renamed from vendor/clap/src/util/graph.rs)0
-rw-r--r--vendor/clap-3.2.20/src/util/id.rs (renamed from vendor/clap/src/util/id.rs)0
-rw-r--r--vendor/clap-3.2.20/src/util/mod.rs (renamed from vendor/clap/src/util/mod.rs)0
-rw-r--r--vendor/clap-3.2.20/src/util/str_to_bool.rs (renamed from vendor/clap/src/util/str_to_bool.rs)0
-rw-r--r--vendor/clap/.cargo-checksum.json1
-rw-r--r--vendor/clap/Cargo.lock745
-rw-r--r--vendor/clap/Cargo.toml493
-rw-r--r--vendor/clap/README.md179
-rw-r--r--vendor/clap/examples/README.md40
-rw-r--r--vendor/clap/examples/derive_ref/README.md440
-rw-r--r--vendor/clap/examples/derive_ref/augment_args.rs30
-rw-r--r--vendor/clap/examples/git.rs103
-rw-r--r--vendor/clap/examples/multicall-hostname.md14
-rw-r--r--vendor/clap/examples/pacman.rs114
-rw-r--r--vendor/clap/examples/tutorial_builder/02_crate.rs19
-rw-r--r--vendor/clap/examples/tutorial_builder/03_01_flag_bool.rs21
-rw-r--r--vendor/clap/examples/tutorial_builder/03_01_flag_count.rs16
-rw-r--r--vendor/clap/examples/tutorial_builder/03_02_option.rs11
-rw-r--r--vendor/clap/examples/tutorial_builder/03_03_positional.rs9
-rw-r--r--vendor/clap/examples/tutorial_builder/04_01_enum.rs32
-rw-r--r--vendor/clap/examples/tutorial_builder/04_03_relations.rs82
-rw-r--r--vendor/clap/examples/tutorial_builder/05_01_assert.rs26
-rw-r--r--vendor/clap/examples/tutorial_builder/README.md658
-rw-r--r--vendor/clap/examples/tutorial_derive/02_crate.rs17
-rw-r--r--vendor/clap/examples/tutorial_derive/04_01_enum.rs28
-rw-r--r--vendor/clap/examples/tutorial_derive/04_03_relations.rs72
-rw-r--r--vendor/clap/examples/tutorial_derive/05_01_assert.rs21
-rw-r--r--vendor/clap/examples/tutorial_derive/README.md639
-rw-r--r--vendor/clap/src/error/kind.rs440
-rw-r--r--vendor/clap/src/error/mod.rs1158
-rw-r--r--vendor/clap/src/lib.rs149
-rw-r--r--vendor/clap/src/macros.rs1062
-rw-r--r--vendor/clap/src/parser/error.rs56
-rw-r--r--vendor/clap_derive/.cargo-checksum.json2
-rw-r--r--vendor/clap_derive/Cargo.toml5
-rw-r--r--vendor/clap_derive/LICENSE-MIT2
-rw-r--r--vendor/clap_derive/README.md4
-rw-r--r--vendor/clap_derive/src/attrs.rs159
-rw-r--r--vendor/clap_derive/src/derives/value_enum.rs2
-rw-r--r--vendor/clap_derive/src/parse.rs4
-rw-r--r--vendor/clap_lex-0.2.2/.cargo-checksum.json (renamed from vendor/clap_lex/.cargo-checksum.json)0
-rw-r--r--vendor/clap_lex-0.2.2/Cargo.toml (renamed from vendor/clap_lex/Cargo.toml)0
-rw-r--r--vendor/clap_lex-0.2.2/LICENSE-APACHE (renamed from vendor/clap/LICENSE-APACHE)0
-rw-r--r--vendor/clap_lex-0.2.2/LICENSE-MIT (renamed from vendor/clap/LICENSE-MIT)0
-rw-r--r--vendor/clap_lex-0.2.2/README.md (renamed from vendor/clap_lex/README.md)0
-rw-r--r--vendor/clap_lex-0.2.2/src/lib.rs (renamed from vendor/clap_lex/src/lib.rs)0
-rw-r--r--vendor/clap_lex/LICENSE-APACHE201
-rw-r--r--vendor/clap_lex/LICENSE-MIT21
209 files changed, 7576 insertions, 7203 deletions
diff --git a/vendor/clap-3.2.20/.cargo-checksum.json b/vendor/clap-3.2.20/.cargo-checksum.json
new file mode 100644
index 000000000..22fa24875
--- /dev/null
+++ b/vendor/clap-3.2.20/.cargo-checksum.json
@@ -0,0 +1 @@
+{"files":{"Cargo.lock":"60560d6b2bec73734ebea64f8b916cbe9361e672157119801ba0e2f89334453c","Cargo.toml":"5def59eada2aa1a035cb39b38da4ba02baec2dd9271e4ef16731a8ef06c4d58f","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"0d687e1f07b58fe68bda74668ff6326125e5e5efa184cce755cd84ac535b7058","README.md":"ee049ee3ccab683cd3fa7c980db71c22ed8577378433cad5a93c1bc2a9dbe20f","examples/cargo-example-derive.md":"8305e66dd56619ec3a1d116951c893965cc8435574f5bf8baea923492357c626","examples/cargo-example-derive.rs":"a94003c9fadd1a11c35616ea4e5132c768bad08650e207848e1de56bffd86c8f","examples/cargo-example.md":"b7e51be8f05538ae39ce232ef12c873af81ab5abb5740c079d09b7cdd27a3b71","examples/cargo-example.rs":"be19a1ccb9d91882d76e7553f692ef89fa2a7acbbc1500232ce9fb60b6e8a85b","examples/demo.md":"9db305e9ff333f5e783dcc3142683280816d7bc111a57e9dcc4127f07ca44055","examples/demo.rs":"8a18ab15a235b84efd82017e51a891ed2df5f0154adbfce2806dcac089296b64","examples/derive_ref/augment_args.rs":"93fa1e122328a5d12ca4f921d17902dff6ec47b69fb2140124e2a00809ec4a1a","examples/derive_ref/augment_subcommands.rs":"5535f8ca1893101acb5eba8edc311497431ff9aa26f62f1d9743bdc147bef7a4","examples/derive_ref/custom-bool.md":"d92e441199c7584d4b888c45124366cc4802ec8ea67cdcbb3423ffaa3c5268ac","examples/derive_ref/custom-bool.rs":"f88e9c68d2447a24bc98e05124fea17836155f32cff30a2b8a03ad254383247c","examples/derive_ref/flatten_hand_args.rs":"abdb4e55b0cb71e5c4d14fe20ae0930df6888b2dca01225a02d3c6828bcbc791","examples/derive_ref/hand_subcommand.rs":"1a5464b9c5791361930b5591adeb6fcf6f14b83abdfa6443d2c80bcf0c097b3e","examples/derive_ref/interop_tests.md":"3a357e82cfc155f71e0348be33f78295aa77839c3e3a5b7c1783cbd1259e6a61","examples/escaped-positional-derive.md":"64329a454ad399cfde7cae37c2419fb68f1dfcdf2b7d809e113bab69c5f9b947","examples/escaped-positional-derive.rs":"68b0b474509d0d0b19a2ad756c15a18a9d3b30278390ddf1b7bc11b40fe5f937","examples/escaped-positional.md":"a8259da128ad7ad1f898527bb9e3c1c55541fdc2a59a8599fcddbe9cf58a3563","examples/escaped-positional.rs":"ca33f37267df8de835eeb5817e906a957e96c4ee9bd95b97abee3af25639f3c2","examples/git-derive.md":"280909b56757f102cad3a3274a92c884a0cec4e698c0f8718d2edee73fbbd810","examples/git-derive.rs":"2e8310364f2622b1b11c916643dda7392ec4a4fd585f30d537672d2fed48ea6e","examples/git.md":"31c172433b05ce581179aaba10d610de5cf097b0da894f1330a0437ef332feab","examples/git.rs":"9da386531604fc2afbd375685e213200ad10e34100ec92b4bfa6fb5730283aa1","examples/multicall-busybox.md":"0e07a2f79f94daf4586db85bf207b4bd8f0653b59858d6b4f0b66956a5b2178f","examples/multicall-busybox.rs":"709f71a82295a539d0a239371d35d1eeb517eaa3bb0a4db406bb7e5d3541a4a5","examples/multicall-hostname.md":"b547e42135269ab1e8be8dea4da6a4e99dfaa006a320fa319198d5934e1e97ab","examples/multicall-hostname.rs":"cc58a924dd2e57281f36e30481a1cbc8186952adbf149f9e1e13f9c673614fd9","examples/pacman.md":"c91e1582caf8a2cdeca208c856d1ede3f3ff26948b288a98ef69ea695f12f555","examples/pacman.rs":"f249824b950e1c34fae37afe04389143a037452a1f699c215172ac20e0285984","examples/repl.rs":"d50c1da634c237b26989994b1efa6fd1a087874a82d1fc8c1863be4ea8deaa8c","examples/tutorial_builder/01_quick.md":"80878c8630e0ecf7bb172c2645c2c17480ca5a37e5f4f481ab99e88d3a37da8e","examples/tutorial_builder/01_quick.rs":"c19b165fce9468fb3c9d3d9354a2b9829ceea7ffba6b7134d4941a6e986429a9","examples/tutorial_builder/02_app_settings.md":"f0f7b48afa7a97c9270f9d63a0e9e0f3117733ee0201639eae2199a4aca4944e","examples/tutorial_builder/02_app_settings.rs":"dd770d131726c3f37e202c9b10c969cc4eba90249c54a05594535cea6efe2749","examples/tutorial_builder/02_apps.md":"815a9197925d403b1d93969ace87e80e32667333fa83f2c86abcbdfa17cf0d7e","examples/tutorial_builder/02_apps.rs":"a7016469d10259ae0025fb6ad5b9d3c732cf082869348005d4774d2bb0722d2d","examples/tutorial_builder/02_crate.md":"086581912b34d305bb7cf3c5a35238c151bd366fac4c0923057883253731c250","examples/tutorial_builder/02_crate.rs":"2742c6a3f1946b89b4f1146893e126d68e1cf55ad4130fb94105091900421273","examples/tutorial_builder/03_01_flag_bool.md":"068378b1e76ce624dd0153dfaa9a7ae2d1a84205b1e169f5f1a16bebd50715cf","examples/tutorial_builder/03_01_flag_bool.rs":"d49b30b527faa6a383b334e572d546fab5c4b298a5549842073ab42a33a05c94","examples/tutorial_builder/03_01_flag_count.md":"8d62fbef076eac962a1d0082afa4916de22277aee973d693de33e9fd73b16669","examples/tutorial_builder/03_01_flag_count.rs":"2bfaac3aa9bcbbf37e18e74a40d966391e208d44b45a1e9c4ab61d22fd14dd40","examples/tutorial_builder/03_02_option.md":"585793524138da00c25b9fdd883b25eb8addfaf8742365d84cde63169a9289a7","examples/tutorial_builder/03_02_option.rs":"ce43934605e0438f1e8706e5e970cfcd930f76c4ebee02450ffc63de520994bd","examples/tutorial_builder/03_03_positional.md":"46fe5085841342243efd9614e80db7db3c52ae5af7c6cdd402b569d310e63fe9","examples/tutorial_builder/03_03_positional.rs":"fc7538d0fe8501c56070f0f22be699f128890636aa4ff8478cd6c7beeea279da","examples/tutorial_builder/03_04_subcommands.md":"fc5a92c5290b3cc119a6421779cdd8f4791465a1d3f50f4f29ccb08f3063a6f5","examples/tutorial_builder/03_04_subcommands.rs":"a309a332004edbed6dc14b64b1ba6cc0cd42871f3c5b8da7daab772764839c68","examples/tutorial_builder/03_05_default_values.md":"431800610a29d9a5587b74b30d709e67af5a0b8980900de20e5876fb9491144c","examples/tutorial_builder/03_05_default_values.rs":"b277be9cfe5d87958f9cf2e8a178bb007b070723528bedc8b81163aedb3a2880","examples/tutorial_builder/04_01_enum.md":"d1310efc5c8acb5ca9c86b57deebbcbd8766869284d2e8ea51e32b3eeac38439","examples/tutorial_builder/04_01_enum.rs":"596aa44bc401674a4ccf091b81b2df79b911dbb01d61fd167fd270d1e21a3609","examples/tutorial_builder/04_01_possible.md":"308cd6530b3c389bf2a82b2b66ad33025be230d84d94835273af35a90eb6a753","examples/tutorial_builder/04_01_possible.rs":"3d781b26d257061b55a957744c2dbd99c1d2346c151230fb18fe5f576d19585c","examples/tutorial_builder/04_02_parse.md":"ea14a355913fd7a8af5aac4be2bdecfda72c039b62ccadfb91ff8d39a447955e","examples/tutorial_builder/04_02_parse.rs":"a65f596341e65f41d555b38a6f5e22a5e03aac6faa4e8b3e3c85fa0e0935a2d7","examples/tutorial_builder/04_02_validate.md":"7536f4fb1a11ab94e54b6b98b7364c77912b7600803aeda5988c5b29f3f037c8","examples/tutorial_builder/04_02_validate.rs":"af6d9f748c6956aaa1006ce96834e0d013a9dbfb6d0acc63df5eb63caac56eef","examples/tutorial_builder/04_03_relations.md":"ffc6b8a2d606856fbb6cce677c5280e08eaffbe6a4c8e40cd68ce35959370ed7","examples/tutorial_builder/04_03_relations.rs":"a2dbb6d77587f64775ef57c4bb3869a2760e5c124e2870898bbf1191ef349b99","examples/tutorial_builder/04_04_custom.md":"d562fd072b5d91e8ea145771a2b6eb0284d3d21bfac707ba48ee00e92d76ad2d","examples/tutorial_builder/04_04_custom.rs":"ea0879629da2dab2d2e7fd25bdde53386d863a3e2d468e7ea306a6f8240a5522","examples/tutorial_builder/05_01_assert.rs":"69fc5a3d330be1f90055f886d65684204d7f0585459f362cf3c43b5caf4bbd7b","examples/tutorial_derive/01_quick.md":"1416029b09409468ba6b39ae5f91c41547f7f389c2534961f867ab17260638da","examples/tutorial_derive/01_quick.rs":"e17262c915199c4507d8950d5eafb73f3047e09b6dee2abbfe9f82ebf1b7ddd5","examples/tutorial_derive/02_app_settings.md":"3f4a81ebc7b674482768763bab70acf9bc31f68cc3ecb118c6f5493feaff3d42","examples/tutorial_derive/02_app_settings.rs":"7e81f4c1640b0bfbd87aedd3eda79ae7c47c669dee79b643b35e54c1dc076ee8","examples/tutorial_derive/02_apps.md":"27d22d45e438f60b346d34508a75783871e0fe9b1ae41ec759e56118a10feff7","examples/tutorial_derive/02_apps.rs":"e8cd02b5983b2203f1585b96858fade4cedfb124e366171d6b21fcb3f05b514e","examples/tutorial_derive/02_crate.md":"eb396e17db1dd68eb7689bcd806b63dbfe01ad48dfc12c285f00c42e1d4b8c1f","examples/tutorial_derive/02_crate.rs":"0b12a0790d23cee1e5d275893f428cc0af36d5532c2af00806e64c18ef9d309c","examples/tutorial_derive/03_01_flag_bool.md":"f6dd5ab050f0f1ac5924949a4ba45f248b2d4b1bd77210d78b9d8e9b3395d111","examples/tutorial_derive/03_01_flag_bool.rs":"07c31218d0332d7437d80e19c7e3c7be711bf0f56bee3ffb1c4d6f7f253b9304","examples/tutorial_derive/03_01_flag_count.md":"74d5c8a79581ceb7e6a11ec20ae59fa8c7f42591e10464aad50bbdd3d06916fc","examples/tutorial_derive/03_01_flag_count.rs":"945be42994845145b9c579b3834f8c6375f239293ded84fba35754bbe9fdcf9b","examples/tutorial_derive/03_02_option.md":"034b65008d05c1598fe3c1918f23d654d7a14cb610dd636a3c649d9d7a3b1559","examples/tutorial_derive/03_02_option.rs":"48be4cf49b498173200ad86d5d3cd64ce9381f86fdaaab70f05fc471f64a2185","examples/tutorial_derive/03_03_positional.md":"14f6b36eee218a38733b534e7b621f68a6f799bd96682a82980cba9f6e99a40e","examples/tutorial_derive/03_03_positional.rs":"f368ab1465ee4d84b84d175b97af6f64ce0676bec2482adef3ce966d2d8de26a","examples/tutorial_derive/03_04_subcommands.md":"3e1870fb10c78a01b63903060b1164f3f4d0e51c052e449abe11e2d06c252811","examples/tutorial_derive/03_04_subcommands.rs":"b25c8aec8f3816923b1154be91caafe0c2d2841fc1af5f0ef048f03d1273879e","examples/tutorial_derive/03_04_subcommands_alt.rs":"7ba6e81c2af6085b7e2721254500b34ee3e8622e20790b3c6f2786e165151b70","examples/tutorial_derive/03_05_default_values.md":"9ac52230ba7d9c214dcb64922cbf161970947d9650e8e7ea8d0ee949eba99c0e","examples/tutorial_derive/03_05_default_values.rs":"0ba14153a3c72a2435ac3688b990171a1670eb3f2f7cef21886732e489fad435","examples/tutorial_derive/04_01_enum.md":"ee57dc12a88a560d70f344629ac79cc497f96e967e97b4c643467747c8075172","examples/tutorial_derive/04_01_enum.rs":"d30abd8570357be26871c06939dee8173d34408250b6bdc3b1e76f1cbc06f888","examples/tutorial_derive/04_02_parse.md":"f191e6c77e6b133f78bd1123cec2b09c8dfe8bb17198d6348e26adade7465daf","examples/tutorial_derive/04_02_parse.rs":"fbb23ef2d98d3cb401cec9dd29d5818e4c189cc9f54fe961a2fbd08632a9634c","examples/tutorial_derive/04_02_validate.md":"c88670017d06261d454818ff18f21a06275f35d564e637c5346ce3b7fca8a02b","examples/tutorial_derive/04_02_validate.rs":"87d9c465f912b69e5839ea87404a221a39421404012c1a7fd6e327b03ceb12f0","examples/tutorial_derive/04_03_relations.md":"5657bbeee193f21a312db682cfa216f1001a94ace024c56a959985feb2e29069","examples/tutorial_derive/04_03_relations.rs":"eb8e737733261d3d1b7f4def7a05c37ba7c1c010357c7de33ee42c8adfdf6dc2","examples/tutorial_derive/04_04_custom.md":"9627d0025c5c063682387d8e00b3fb097114d1431c1ce8808038be34f781576a","examples/tutorial_derive/04_04_custom.rs":"0e745c6dab0881c62190e82e01409b70cf3286dd0983db4a612f1be88fdd1a8d","examples/tutorial_derive/05_01_assert.rs":"653450ff2e528f29b6b31d979fd7da094ea8e74b8b61a4657935c9ac2efbc28e","examples/typed-derive.md":"c22bb8da2e294f1d3725624e0c442713e5f263b10a2ee76a22ffa07f89af735a","examples/typed-derive.rs":"1c88bb1c8cec4e2e7a452552fa52675d96ffd6f201f5384b4e98d0a70fce1e4c","src/_cookbook/cargo_example.rs":"fe7594a5233e9106a159aa1f5d5f0cde0d844356f630d55c78b8ef322327d4e5","src/_cookbook/cargo_example_derive":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/_cookbook/cargo_example_derive.rs":"badf3e931ef5d5b7f5addc4912aca057ba83ee6302c43d7eeecd1661673fd407","src/_cookbook/escaped_positional.rs":"2789d8fea126355805b29e76b52c6cea4982565014087a46e0d48e4ddfbed7ab","src/_cookbook/escaped_positional_derive.rs":"802d0b672f4ed48152235d4a26a64c97fa921b361177bdd3a1a33cbac96f665d","src/_cookbook/git.rs":"372977252a22fc776e3acaa4629e964114ccd6a49b8ef334d2b6646f12e8b5ee","src/_cookbook/git_derive.rs":"4ab7c0197efda06607ca60c2a85ea743aed3494f5fe9e408d935ea0500a345fc","src/_cookbook/mod.rs":"34c53c6273512976676a82dded921f8d99e0312dd3e823ae1549606754625827","src/_cookbook/multicall_busybox.rs":"56176b4fa15e7a39c433706971d4e68aaf26ddc2a5790078b6dbe722ee13efee","src/_cookbook/multicall_hostname.rs":"907f8decf81ea4d4cbf81639ea4cd2f925eda64d4831454a7656369b65522780","src/_cookbook/pacman.rs":"863125b2d3d7931a9e4541c8ab1242b8bfcb421d8b5c604ea681efd805f68da7","src/_cookbook/repl.rs":"1393209b2cc5c203296d57c5a065b764b4318be7855e48baf16de851e250cf90","src/_cookbook/typed_derive.rs":"3d28e78cd0b068b4fcb32a7fea6244de176f2fe75dfcb59e99c33b66a7ae4864","src/_derive/_tutorial.rs":"237d316ad5f9838dc011283e454afce24d47bf2e9c5038ba5402bafeb2959090","src/_derive/mod.rs":"7f1f6b59332044681324f0753dfb51641e52f46dee74a21b8c94a413bc06be02","src/_faq.rs":"06d10de865ae34305fa973db9b00dc31f54e0f63f8fe039805aa371c36a796b9","src/_features.rs":"bbcbf1b256136d20f89e4f8a16ff37b04f07dfee0d2d4f2b013f445467628032","src/_tutorial.rs":"e7c7359b6b6c86cf6e18f4bdc3c90ce440b82bf07ce304ca2e127fb2a04cbf9f","src/bin/stdio-fixture.rs":"e8f10afbfe1857bcf986d2f55be0ca19a50c905d9f650c6e1fd42dbacf219b04","src/builder/action.rs":"beab4d8dca6337dfd64f387ee3198a88a6dcb71ec94f5bbbfe6bb4c0175ab9ee","src/builder/app_settings.rs":"17b094a5c044b2387467706bade1b19b5703bf99fc5081ac9508f410f871a1f2","src/builder/arg.rs":"e7120b60bf72d2572fc1f325b377a32da9ece4d7ac00b4a580a0f6a42c08ea8a","src/builder/arg_group.rs":"263d9c79e03015fe4e2fab4616fc73089be60fb2ec17aa2a06f3d6a24740432c","src/builder/arg_predicate.rs":"8c9fd14780cd42465f32f2e8927b97c06e686d09b5927ba3cd5bbd792af7a13d","src/builder/arg_settings.rs":"b7966dfea529a1be1164ca2d76494b1712cb2f73b024d2a23307dcd473933887","src/builder/command.rs":"57f0076465feb3cf6a0a16610b345fae8dbde8d248e4ef94111a27051c40789b","src/builder/debug_asserts.rs":"d1d5adc82cb8269445b2ef197f1e566f61e7f13d6a24afaad928e45e95aed170","src/builder/macros.rs":"904e42e72c49107ae324f45d5df24fbff13b9c7d4589f1a4ae38594add704434","src/builder/mod.rs":"205367cb5ba5d5ba7894091535ce3a5dd23b35fd436e003196d89523e7705566","src/builder/possible_value.rs":"62268b9da9eec8f4d1904ebfbd3a288fb78cfa71c357efadced28f0378bcfb93","src/builder/regex.rs":"b18891310186ecdcca9bb611833b7188cc80fe72e9fef27b63fa076b880a1acb","src/builder/tests.rs":"995c7d6be608b94c6f392f1356eba0cb8adb9ca661ffeebf7ebe6e8ad01a868c","src/builder/usage_parser.rs":"91d1af89196116aac2c0fb021f42f43f954aa3252df264e19a02a0cf5911d16b","src/builder/value_hint.rs":"0dd974d495c313430898d28b79991a70983c9aa44e88fa9aa1776d3308935438","src/builder/value_parser.rs":"64bb7f4808bdf65f30cb434198038a06db556e5ca045d900da392cc1a3186896","src/derive.rs":"11eaddc27a06229322a6bbce4458cb1424e6a5805c79166cba342c2905093b51","src/error/context.rs":"1dc561c7877d7f9b90f04bb7915744f0b3cc4ac2aa928ae100b2825a97077142","src/error/kind.rs":"3b4f9dfe5be5843cec8380c8f8965dcb9d0beee0aaa02cadf8dcffd400626ede","src/error/mod.rs":"e5b60fee401975d95c460c2567d09e17972eaae336154a8b90d9c806083f63fa","src/lib.rs":"4a197eab3f447c58a266af4f9a787af5c98b18f4612f33d9189cce52f4f9de18","src/macros.rs":"72585e32051a6872bbb29e39f7e9f9a88334a03f39ec3c768984db2f38211001","src/mkeymap.rs":"3565a5bae5d6cdcf8ba41a24eb602c510a14e150c4a6d3085ad72a35778e9c5f","src/output/fmt.rs":"efb741b5854500d946c6c09763ece1badc2b9cd3efa616cb58012039836c2b7f","src/output/help.rs":"ebdd123d6b70279c25af4b08432b547498834853adf99821ff6c6cd65dd87d4e","src/output/mod.rs":"3a61f89a4568e95114a3ab839da8f3c4c92de2a228549308f5d1be076a474917","src/output/usage.rs":"1921d2fa362f111b3f9613fc98eb5e24686483fe112b337855da7eb17b643f71","src/parser/arg_matcher.rs":"0c9ae639ed241e8ff1f62cd9e5eab2de9e5db1be0e86f58d5d94619d6dad05fd","src/parser/error.rs":"51e8fbd7cc73bba78cca50417e9b4fb25e11eefc60ff4b957940176bdb995e5c","src/parser/features/mod.rs":"6ed075e97af56bff22f22ed1ee83ff6479360e05f9d3661a3145f822c242b694","src/parser/features/suggestions.rs":"79127956b2f1adb9d658925e2779ebebfe9ddea434408762fefb60afdb545f47","src/parser/matches/any_value.rs":"7b6e711fe205e8808394c562dd6a260b56ce350cf9298a308ba9727ab012b664","src/parser/matches/arg_matches.rs":"666e3640b5347aba5806fc15b5caa599b171e684ee15d933ddc7f8185a0d2032","src/parser/matches/matched_arg.rs":"fb12eb2afaf631bb60aa8c4e42b0f510a877d35a9eaa07a7afd253280c27c251","src/parser/matches/mod.rs":"1467aa752cb1c79d30e4aeaaa55e10a0bb9dcf6f3980496234251431c79c49e6","src/parser/matches/value_source.rs":"e6a477ae36f2f7155960239a97b7d142eef4eb227c41c9eefea147289547d713","src/parser/mod.rs":"358f46d3b7f43dec2563d4c35bd2536fab2491f28e300a9bcdeaf6ca0513ce12","src/parser/parser.rs":"9e338dfd60aa8bfbcfbbda15c73d4722767a4d2e7b8f8ed3a07c296ddd98762c","src/parser/validator.rs":"30066cb41ab23800231fb6b028cbce57d118570859659ebc67affbe5226f31f9","src/util/color.rs":"63df5e1cda1001b4c536dc0b04e09dd85dae6d317e34e660abbe3c71e17eaa29","src/util/fnv.rs":"82492d91d990f38b62de8b3c3e67f1fad55919117b1f448aa28acf6d21919fd7","src/util/graph.rs":"f35396b6e2a427377dcbbca69b1b98737d89684a3834cfda98cbf8cc70ff9c2f","src/util/id.rs":"fc498c65887385d92a51359a2f72556c2e508ee49b8cac4b3f827512795d690d","src/util/mod.rs":"8d328a15ef06989d0ce5e65cf3b7ec79c083984b25c0b31ba177bdb22df28a10","src/util/str_to_bool.rs":"1ce90b4939a884eeefc73392722bdfcf906e3070c4398e1557c586c10c684cd0"},"package":"23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd"} \ No newline at end of file
diff --git a/vendor/clap-3.2.20/Cargo.lock b/vendor/clap-3.2.20/Cargo.lock
new file mode 100644
index 000000000..57d007104
--- /dev/null
+++ b/vendor/clap-3.2.20/Cargo.lock
@@ -0,0 +1,746 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "addr2line"
+version = "0.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+
+[[package]]
+name = "aho-corasick"
+version = "0.7.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "atty"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "backtrace"
+version = "0.3.66"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7"
+dependencies = [
+ "addr2line",
+ "cc",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bytes"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e"
+
+[[package]]
+name = "cc"
+version = "1.0.73"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clap"
+version = "3.2.20"
+dependencies = [
+ "atty",
+ "backtrace",
+ "bitflags",
+ "clap_derive",
+ "clap_lex",
+ "humantime",
+ "indexmap",
+ "once_cell",
+ "regex",
+ "rustversion",
+ "shlex",
+ "snapbox",
+ "static_assertions",
+ "strsim",
+ "termcolor",
+ "terminal_size",
+ "textwrap",
+ "trybuild",
+ "trycmd",
+ "unicase",
+ "yaml-rust",
+]
+
+[[package]]
+name = "clap_derive"
+version = "3.2.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
+dependencies = [
+ "heck",
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
+dependencies = [
+ "os_str_bytes",
+]
+
+[[package]]
+name = "combine"
+version = "4.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948"
+dependencies = [
+ "bytes",
+ "memchr",
+]
+
+[[package]]
+name = "concolor"
+version = "0.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "015267563b1df20adccdd00cb05257b1dfbea70a04928e9cf88ffb850c1a40af"
+dependencies = [
+ "atty",
+ "bitflags",
+ "concolor-query",
+]
+
+[[package]]
+name = "concolor-query"
+version = "0.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d6417fe6fc03a8b533fd2177742eeb39a90c7233eedec7bac96d4d6b69a09449"
+
+[[package]]
+name = "crossbeam-channel"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c"
+dependencies = [
+ "cfg-if",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
+dependencies = [
+ "cfg-if",
+ "crossbeam-epoch",
+ "crossbeam-utils",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.9.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d"
+dependencies = [
+ "autocfg",
+ "cfg-if",
+ "crossbeam-utils",
+ "memoffset",
+ "once_cell",
+ "scopeguard",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+]
+
+[[package]]
+name = "either"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
+
+[[package]]
+name = "escargot"
+version = "0.5.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f5584ba17d7ab26a8a7284f13e5bd196294dd2f2d79773cff29b9e9edef601a6"
+dependencies = [
+ "log",
+ "once_cell",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "gimli"
+version = "0.26.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
+
+[[package]]
+name = "glob"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
+[[package]]
+name = "heck"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "humantime"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
+
+[[package]]
+name = "humantime-serde"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
+dependencies = [
+ "humantime",
+ "serde",
+]
+
+[[package]]
+name = "indexmap"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
+name = "itertools"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
+
+[[package]]
+name = "libc"
+version = "0.2.126"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
+
+[[package]]
+name = "linked-hash-map"
+version = "0.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
+
+[[package]]
+name = "log"
+version = "0.4.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "memchr"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
+
+[[package]]
+name = "memoffset"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
+dependencies = [
+ "adler",
+]
+
+[[package]]
+name = "normalize-line-endings"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
+
+[[package]]
+name = "num_cpus"
+version = "1.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
+dependencies = [
+ "hermit-abi",
+ "libc",
+]
+
+[[package]]
+name = "object"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
+
+[[package]]
+name = "os_pipe"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c92f2b54f081d635c77e7120862d48db8e91f7f21cef23ab1b4fe9971c59f55"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "os_str_bytes"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
+
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rayon"
+version = "1.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d"
+dependencies = [
+ "autocfg",
+ "crossbeam-deque",
+ "either",
+ "rayon-core",
+]
+
+[[package]]
+name = "rayon-core"
+version = "1.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f"
+dependencies = [
+ "crossbeam-channel",
+ "crossbeam-deque",
+ "crossbeam-utils",
+ "num_cpus",
+]
+
+[[package]]
+name = "regex"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.6.27"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
+
+[[package]]
+name = "rustversion"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8"
+
+[[package]]
+name = "ryu"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
+
+[[package]]
+name = "scopeguard"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
+
+[[package]]
+name = "serde"
+version = "1.0.139"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.139"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "shlex"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
+
+[[package]]
+name = "similar"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3"
+
+[[package]]
+name = "snapbox"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "767a1d5da232b6959cd1bd5c9e8db8a7cce09c3038e89deedb49a549a2aefd93"
+dependencies = [
+ "concolor",
+ "normalize-line-endings",
+ "os_pipe",
+ "similar",
+ "snapbox-macros",
+ "wait-timeout",
+ "yansi",
+]
+
+[[package]]
+name = "snapbox-macros"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c01dea7e04cbb27ef4c86e9922184608185f7cd95c1763bc30d727cda4a5e930"
+
+[[package]]
+name = "static_assertions"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+
+[[package]]
+name = "strsim"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+
+[[package]]
+name = "syn"
+version = "1.0.98"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "terminal_size"
+version = "0.1.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
+dependencies = [
+ "terminal_size",
+ "unicode-width",
+]
+
+[[package]]
+name = "toml"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.14.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f"
+dependencies = [
+ "combine",
+ "indexmap",
+ "itertools",
+ "serde",
+]
+
+[[package]]
+name = "trybuild"
+version = "1.0.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "764b9e244b482a9b81bde596aa37aa6f1347bf8007adab25e59f901b32b4e0a0"
+dependencies = [
+ "glob",
+ "once_cell",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "termcolor",
+ "toml",
+]
+
+[[package]]
+name = "trycmd"
+version = "0.13.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ffb4185126cc904642173a54c185083f410c86d1202ada6761aacf7c40829f13"
+dependencies = [
+ "escargot",
+ "glob",
+ "humantime",
+ "humantime-serde",
+ "rayon",
+ "serde",
+ "shlex",
+ "snapbox",
+ "toml_edit",
+]
+
+[[package]]
+name = "unicase"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
+dependencies = [
+ "version_check",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
+
+[[package]]
+name = "version_check"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+
+[[package]]
+name = "wait-timeout"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "yaml-rust"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
+dependencies = [
+ "linked-hash-map",
+]
+
+[[package]]
+name = "yansi"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
diff --git a/vendor/clap-3.2.20/Cargo.toml b/vendor/clap-3.2.20/Cargo.toml
new file mode 100644
index 000000000..197454c07
--- /dev/null
+++ b/vendor/clap-3.2.20/Cargo.toml
@@ -0,0 +1,471 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2021"
+rust-version = "1.56.1"
+name = "clap"
+version = "3.2.20"
+include = [
+ "build.rs",
+ "src/**/*",
+ "Cargo.toml",
+ "LICENSE*",
+ "README.md",
+ "benches/**/*",
+ "examples/**/*",
+]
+description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
+readme = "README.md"
+keywords = [
+ "argument",
+ "cli",
+ "arg",
+ "parser",
+ "parse",
+]
+categories = ["command-line-interface"]
+license = "MIT OR Apache-2.0"
+repository = "https://github.com/clap-rs/clap"
+resolver = "2"
+
+[package.metadata.docs.rs]
+features = ["unstable-doc"]
+rustdoc-args = [
+ "--cfg",
+ "docsrs",
+]
+cargo-args = [
+ "-Zunstable-options",
+ "-Zrustdoc-scrape-examples=examples",
+]
+
+[package.metadata.playground]
+features = ["unstable-doc"]
+
+[package.metadata.release]
+shared-version = true
+tag-name = "v{{version}}"
+
+[[package.metadata.release.pre-release-replacements]]
+file = "CHANGELOG.md"
+search = "Unreleased"
+replace = "{{version}}"
+min = 1
+
+[[package.metadata.release.pre-release-replacements]]
+file = "CHANGELOG.md"
+search = '\.\.\.HEAD'
+replace = "...{{tag_name}}"
+exactly = 1
+
+[[package.metadata.release.pre-release-replacements]]
+file = "CHANGELOG.md"
+search = "ReleaseDate"
+replace = "{{date}}"
+min = 1
+
+[[package.metadata.release.pre-release-replacements]]
+file = "CHANGELOG.md"
+search = "<!-- next-header -->"
+replace = """
+<!-- next-header -->
+## [Unreleased] - ReleaseDate
+"""
+exactly = 1
+
+[[package.metadata.release.pre-release-replacements]]
+file = "CHANGELOG.md"
+search = "<!-- next-url -->"
+replace = """
+<!-- next-url -->
+[Unreleased]: https://github.com/clap-rs/clap/compare/{{tag_name}}...HEAD"""
+exactly = 1
+
+[profile.bench]
+lto = true
+codegen-units = 1
+
+[profile.test]
+opt-level = 1
+
+[lib]
+bench = false
+
+[[example]]
+name = "demo"
+required-features = ["derive"]
+
+[[example]]
+name = "cargo-example"
+required-features = ["cargo"]
+
+[[example]]
+name = "cargo-example-derive"
+required-features = ["derive"]
+
+[[example]]
+name = "escaped-positional"
+required-features = ["cargo"]
+
+[[example]]
+name = "escaped-positional-derive"
+required-features = ["derive"]
+
+[[example]]
+name = "git-derive"
+required-features = ["derive"]
+
+[[example]]
+name = "typed-derive"
+required-features = ["derive"]
+
+[[example]]
+name = "busybox"
+path = "examples/multicall-busybox.rs"
+
+[[example]]
+name = "hostname"
+path = "examples/multicall-hostname.rs"
+
+[[example]]
+name = "repl"
+path = "examples/repl.rs"
+
+[[example]]
+name = "01_quick"
+path = "examples/tutorial_builder/01_quick.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "02_apps"
+path = "examples/tutorial_builder/02_apps.rs"
+
+[[example]]
+name = "02_crate"
+path = "examples/tutorial_builder/02_crate.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "02_app_settings"
+path = "examples/tutorial_builder/02_app_settings.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "03_01_flag_bool"
+path = "examples/tutorial_builder/03_01_flag_bool.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "03_01_flag_count"
+path = "examples/tutorial_builder/03_01_flag_count.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "03_02_option"
+path = "examples/tutorial_builder/03_02_option.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "03_03_positional"
+path = "examples/tutorial_builder/03_03_positional.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "03_04_subcommands"
+path = "examples/tutorial_builder/03_04_subcommands.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "03_05_default_values"
+path = "examples/tutorial_builder/03_05_default_values.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "04_01_possible"
+path = "examples/tutorial_builder/04_01_possible.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "04_01_enum"
+path = "examples/tutorial_builder/04_01_enum.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "04_02_parse"
+path = "examples/tutorial_builder/04_02_parse.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "04_02_validate"
+path = "examples/tutorial_builder/04_02_validate.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "04_03_relations"
+path = "examples/tutorial_builder/04_03_relations.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "04_04_custom"
+path = "examples/tutorial_builder/04_04_custom.rs"
+required-features = ["cargo"]
+
+[[example]]
+name = "05_01_assert"
+path = "examples/tutorial_builder/05_01_assert.rs"
+test = true
+required-features = ["cargo"]
+
+[[example]]
+name = "01_quick_derive"
+path = "examples/tutorial_derive/01_quick.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "02_apps_derive"
+path = "examples/tutorial_derive/02_apps.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "02_crate_derive"
+path = "examples/tutorial_derive/02_crate.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "02_app_settings_derive"
+path = "examples/tutorial_derive/02_app_settings.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_01_flag_bool_derive"
+path = "examples/tutorial_derive/03_01_flag_bool.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_01_flag_count_derive"
+path = "examples/tutorial_derive/03_01_flag_count.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_02_option_derive"
+path = "examples/tutorial_derive/03_02_option.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_03_positional_derive"
+path = "examples/tutorial_derive/03_03_positional.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_04_subcommands_derive"
+path = "examples/tutorial_derive/03_04_subcommands.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_04_subcommands_alt_derive"
+path = "examples/tutorial_derive/03_04_subcommands_alt.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "03_05_default_values_derive"
+path = "examples/tutorial_derive/03_05_default_values.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "04_01_enum_derive"
+path = "examples/tutorial_derive/04_01_enum.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "04_02_parse_derive"
+path = "examples/tutorial_derive/04_02_parse.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "04_02_validate_derive"
+path = "examples/tutorial_derive/04_02_validate.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "04_03_relations_derive"
+path = "examples/tutorial_derive/04_03_relations.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "04_04_custom_derive"
+path = "examples/tutorial_derive/04_04_custom.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "05_01_assert_derive"
+path = "examples/tutorial_derive/05_01_assert.rs"
+test = true
+required-features = ["derive"]
+
+[[example]]
+name = "custom-bool"
+path = "examples/derive_ref/custom-bool.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "interop_augment_args"
+path = "examples/derive_ref/augment_args.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "interop_augment_subcommands"
+path = "examples/derive_ref/augment_subcommands.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "interop_hand_subcommand"
+path = "examples/derive_ref/hand_subcommand.rs"
+required-features = ["derive"]
+
+[[example]]
+name = "interop_flatten_hand_args"
+path = "examples/derive_ref/flatten_hand_args.rs"
+required-features = ["derive"]
+
+[dependencies.atty]
+version = "0.2"
+optional = true
+
+[dependencies.backtrace]
+version = "0.3"
+optional = true
+
+[dependencies.bitflags]
+version = "1.2"
+
+[dependencies.clap_derive]
+version = "=3.2.18"
+optional = true
+
+[dependencies.clap_lex]
+version = "0.2.2"
+
+[dependencies.indexmap]
+version = "1.0"
+
+[dependencies.once_cell]
+version = "1.12.0"
+optional = true
+
+[dependencies.regex]
+version = "1.0"
+optional = true
+
+[dependencies.strsim]
+version = "0.10"
+optional = true
+
+[dependencies.termcolor]
+version = "1.1.1"
+optional = true
+
+[dependencies.terminal_size]
+version = "0.1.12"
+optional = true
+
+[dependencies.textwrap]
+version = "0.15.0"
+features = []
+default-features = false
+
+[dependencies.unicase]
+version = "2.6"
+optional = true
+
+[dependencies.yaml-rust]
+version = "0.4.1"
+optional = true
+
+[dev-dependencies.humantime]
+version = "2"
+
+[dev-dependencies.regex]
+version = "1.0"
+
+[dev-dependencies.rustversion]
+version = "1"
+
+[dev-dependencies.shlex]
+version = "1.1.0"
+
+[dev-dependencies.snapbox]
+version = "0.2.9"
+
+[dev-dependencies.static_assertions]
+version = "1.1.0"
+
+[dev-dependencies.trybuild]
+version = "1.0.18"
+
+[dev-dependencies.trycmd]
+version = "0.13"
+features = [
+ "color-auto",
+ "diff",
+ "examples",
+]
+default-features = false
+
+[features]
+cargo = ["once_cell"]
+color = [
+ "atty",
+ "termcolor",
+]
+debug = [
+ "clap_derive/debug",
+ "backtrace",
+]
+default = [
+ "std",
+ "color",
+ "suggestions",
+]
+deprecated = ["clap_derive/deprecated"]
+derive = [
+ "clap_derive",
+ "once_cell",
+]
+env = []
+std = ["indexmap/std"]
+suggestions = ["strsim"]
+unicode = [
+ "textwrap/unicode-width",
+ "unicase",
+]
+unstable-doc = [
+ "derive",
+ "cargo",
+ "wrap_help",
+ "yaml",
+ "env",
+ "unicode",
+ "regex",
+ "unstable-replace",
+ "unstable-grouped",
+]
+unstable-grouped = []
+unstable-replace = []
+unstable-v4 = [
+ "clap_derive/unstable-v4",
+ "deprecated",
+]
+wrap_help = [
+ "terminal_size",
+ "textwrap/terminal_size",
+]
+yaml = ["yaml-rust"]
diff --git a/vendor/annotate-snippets-0.8.0/LICENSE-APACHE b/vendor/clap-3.2.20/LICENSE-APACHE
index 261eeb9e9..261eeb9e9 100644
--- a/vendor/annotate-snippets-0.8.0/LICENSE-APACHE
+++ b/vendor/clap-3.2.20/LICENSE-APACHE
diff --git a/vendor/clap-3.2.20/LICENSE-MIT b/vendor/clap-3.2.20/LICENSE-MIT
new file mode 100644
index 000000000..7b05b8453
--- /dev/null
+++ b/vendor/clap-3.2.20/LICENSE-MIT
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-2022 Kevin B. Knapp and Clap Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/clap-3.2.20/README.md b/vendor/clap-3.2.20/README.md
new file mode 100644
index 000000000..eea6ba6f0
--- /dev/null
+++ b/vendor/clap-3.2.20/README.md
@@ -0,0 +1,43 @@
+# clap
+
+> **Command Line Argument Parser for Rust**
+
+[![Crates.io](https://img.shields.io/crates/v/clap?style=flat-square)](https://crates.io/crates/clap)
+[![Crates.io](https://img.shields.io/crates/d/clap?style=flat-square)](https://crates.io/crates/clap)
+[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](LICENSE-APACHE)
+[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE-MIT)
+[![Build Status](https://img.shields.io/github/workflow/status/clap-rs/clap/CI/staging?style=flat-square)](https://github.com/clap-rs/clap/actions/workflows/ci.yml?query=branch%3Astaging)
+[![Coverage Status](https://img.shields.io/coveralls/github/clap-rs/clap/master?style=flat-square)](https://coveralls.io/github/clap-rs/clap?branch=master)
+[![Contributors](https://img.shields.io/github/contributors/clap-rs/clap?style=flat-square)](https://github.com/clap-rs/clap/graphs/contributors)
+
+Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT).
+
+## About
+
+Create your command-line parser, with all of the bells and whistles, declaratively or procedurally.
+
+For more details, see:
+- [docs.rs](https://docs.rs/clap/latest/clap/)
+- [examples](examples/)
+
+## Sponsors
+
+<!-- omit in TOC -->
+### Gold
+
+[![](https://opencollective.com/clap/tiers/gold.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
+
+<!-- omit in TOC -->
+### Silver
+
+[![](https://opencollective.com/clap/tiers/silver.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
+
+<!-- omit in TOC -->
+### Bronze
+
+[![](https://opencollective.com/clap/tiers/bronze.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
+
+<!-- omit in TOC -->
+### Backer
+
+[![](https://opencollective.com/clap/tiers/backer.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
diff --git a/vendor/clap/examples/cargo-example-derive.md b/vendor/clap-3.2.20/examples/cargo-example-derive.md
index 994c6d4d8..2c7a11b88 100644
--- a/vendor/clap/examples/cargo-example-derive.md
+++ b/vendor/clap-3.2.20/examples/cargo-example-derive.md
@@ -1,5 +1,3 @@
-*Jump to [source](cargo-example-derive.rs)*
-
For more on creating a custom subcommand, see [the cargo
book](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands).
The crate [`clap-cargo`](https://github.com/crate-ci/clap-cargo) can help in
diff --git a/vendor/clap/examples/cargo-example-derive.rs b/vendor/clap-3.2.20/examples/cargo-example-derive.rs
index 6667a4a7d..f0aad29c7 100644
--- a/vendor/clap/examples/cargo-example-derive.rs
+++ b/vendor/clap-3.2.20/examples/cargo-example-derive.rs
@@ -1,8 +1,6 @@
-// Note: this requires the `derive` feature
-
use clap::Parser;
-#[derive(Parser)]
+#[derive(Parser)] // requires `derive` feature
#[clap(name = "cargo")]
#[clap(bin_name = "cargo")]
enum Cargo {
diff --git a/vendor/clap/examples/cargo-example.md b/vendor/clap-3.2.20/examples/cargo-example.md
index 9279cc492..6fb6a3c4d 100644
--- a/vendor/clap/examples/cargo-example.md
+++ b/vendor/clap-3.2.20/examples/cargo-example.md
@@ -1,5 +1,3 @@
-*Jump to [source](cargo-example.rs)*
-
For more on creating a custom subcommand, see [the cargo
book](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands).
The crate [`clap-cargo`](https://github.com/crate-ci/clap-cargo) can help in
diff --git a/vendor/clap/examples/cargo-example.rs b/vendor/clap-3.2.20/examples/cargo-example.rs
index 45ae67c81..d9a909f4f 100644
--- a/vendor/clap/examples/cargo-example.rs
+++ b/vendor/clap-3.2.20/examples/cargo-example.rs
@@ -1,5 +1,3 @@
-// Note: this requires the `cargo` feature
-
fn main() {
let cmd = clap::Command::new("cargo")
.bin_name("cargo")
diff --git a/vendor/clap/examples/demo.md b/vendor/clap-3.2.20/examples/demo.md
index 9b0e7e260..93ee49c37 100644
--- a/vendor/clap/examples/demo.md
+++ b/vendor/clap-3.2.20/examples/demo.md
@@ -1,8 +1,3 @@
-*Jump to [source](demo.rs)*
-
-**This requires enabling the `derive` feature flag.**
-
-Used to validate README.md's content
```console
$ demo --help
clap [..]
@@ -17,4 +12,8 @@ OPTIONS:
-n, --name <NAME> Name of the person to greet
-V, --version Print version information
+$ demo --name Me
+Hello Me!
+
```
+*(version number and `.exe` extension on windows replaced by placeholders)*
diff --git a/vendor/clap/examples/demo.rs b/vendor/clap-3.2.20/examples/demo.rs
index 957489724..a7cecfb0c 100644
--- a/vendor/clap/examples/demo.rs
+++ b/vendor/clap-3.2.20/examples/demo.rs
@@ -1,5 +1,3 @@
-// Note: this requires the `derive` feature
-
use clap::Parser;
/// Simple program to greet a person
diff --git a/vendor/clap-3.2.20/examples/derive_ref/augment_args.rs b/vendor/clap-3.2.20/examples/derive_ref/augment_args.rs
new file mode 100644
index 000000000..310556914
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/derive_ref/augment_args.rs
@@ -0,0 +1,27 @@
+use clap::{arg, Args, Command, FromArgMatches as _};
+
+#[derive(Args, Debug)]
+struct DerivedArgs {
+ #[clap(short, long, action)]
+ derived: bool,
+}
+
+fn main() {
+ let cli = Command::new("CLI").arg(arg!(-b - -built).action(clap::ArgAction::SetTrue));
+ // Augment built args with derived args
+ let cli = DerivedArgs::augment_args(cli);
+
+ let matches = cli.get_matches();
+ println!("Value of built: {:?}", matches.get_flag("built"));
+ println!(
+ "Value of derived via ArgMatches: {:?}",
+ matches.get_flag("derived")
+ );
+
+ // Since DerivedArgs implements FromArgMatches, we can extract it from the unstructured ArgMatches.
+ // This is the main benefit of using derived arguments.
+ let derived_matches = DerivedArgs::from_arg_matches(&matches)
+ .map_err(|err| err.exit())
+ .unwrap();
+ println!("Value of derived: {:#?}", derived_matches);
+}
diff --git a/vendor/clap/examples/derive_ref/augment_subcommands.rs b/vendor/clap-3.2.20/examples/derive_ref/augment_subcommands.rs
index 199da98b4..199da98b4 100644
--- a/vendor/clap/examples/derive_ref/augment_subcommands.rs
+++ b/vendor/clap-3.2.20/examples/derive_ref/augment_subcommands.rs
diff --git a/vendor/clap/examples/derive_ref/custom-bool.md b/vendor/clap-3.2.20/examples/derive_ref/custom-bool.md
index 619f9ba8e..619f9ba8e 100644
--- a/vendor/clap/examples/derive_ref/custom-bool.md
+++ b/vendor/clap-3.2.20/examples/derive_ref/custom-bool.md
diff --git a/vendor/clap/examples/derive_ref/custom-bool.rs b/vendor/clap-3.2.20/examples/derive_ref/custom-bool.rs
index d3c321e72..d3c321e72 100644
--- a/vendor/clap/examples/derive_ref/custom-bool.rs
+++ b/vendor/clap-3.2.20/examples/derive_ref/custom-bool.rs
diff --git a/vendor/clap/examples/derive_ref/flatten_hand_args.rs b/vendor/clap-3.2.20/examples/derive_ref/flatten_hand_args.rs
index 74d10edec..c10e0b29f 100644
--- a/vendor/clap/examples/derive_ref/flatten_hand_args.rs
+++ b/vendor/clap-3.2.20/examples/derive_ref/flatten_hand_args.rs
@@ -15,8 +15,8 @@ impl FromArgMatches for CliArgs {
}
fn from_arg_matches_mut(matches: &mut ArgMatches) -> Result<Self, Error> {
Ok(Self {
- foo: *matches.get_one::<bool>("foo").expect("defaulted by clap"),
- bar: *matches.get_one::<bool>("bar").expect("defaulted by clap"),
+ foo: matches.get_flag("foo"),
+ bar: matches.get_flag("bar"),
quuz: matches.remove_one::<String>("quuz"),
})
}
@@ -25,8 +25,8 @@ impl FromArgMatches for CliArgs {
self.update_from_arg_matches_mut(&mut matches)
}
fn update_from_arg_matches_mut(&mut self, matches: &mut ArgMatches) -> Result<(), Error> {
- self.foo |= *matches.get_one::<bool>("foo").expect("defaulted by clap");
- self.bar |= *matches.get_one::<bool>("bar").expect("defaulted by clap");
+ self.foo |= matches.get_flag("foo");
+ self.bar |= matches.get_flag("bar");
if let Some(quuz) = matches.remove_one::<String>("quuz") {
self.quuz = Some(quuz);
}
diff --git a/vendor/clap/examples/derive_ref/hand_subcommand.rs b/vendor/clap-3.2.20/examples/derive_ref/hand_subcommand.rs
index e9423bdc0..e9423bdc0 100644
--- a/vendor/clap/examples/derive_ref/hand_subcommand.rs
+++ b/vendor/clap-3.2.20/examples/derive_ref/hand_subcommand.rs
diff --git a/vendor/clap/examples/derive_ref/interop_tests.md b/vendor/clap-3.2.20/examples/derive_ref/interop_tests.md
index 746fe1878..746fe1878 100644
--- a/vendor/clap/examples/derive_ref/interop_tests.md
+++ b/vendor/clap-3.2.20/examples/derive_ref/interop_tests.md
diff --git a/vendor/clap/examples/escaped-positional-derive.md b/vendor/clap-3.2.20/examples/escaped-positional-derive.md
index 3b5f8fe56..fa39a2c03 100644
--- a/vendor/clap/examples/escaped-positional-derive.md
+++ b/vendor/clap-3.2.20/examples/escaped-positional-derive.md
@@ -1,6 +1,4 @@
-*Jump to [source](escaped-positional-derive.rs)*
-
-**This requires enabling the `derive` feature flag.**
+**This requires enabling the [`derive` feature flag][crate::_features].**
You can use `--` to escape further arguments.
diff --git a/vendor/clap/examples/escaped-positional-derive.rs b/vendor/clap-3.2.20/examples/escaped-positional-derive.rs
index 54dbc853b..fd8fde4ed 100644
--- a/vendor/clap/examples/escaped-positional-derive.rs
+++ b/vendor/clap-3.2.20/examples/escaped-positional-derive.rs
@@ -1,8 +1,6 @@
-// Note: this requires the `derive` feature
-
use clap::Parser;
-#[derive(Parser)]
+#[derive(Parser)] // requires `derive` feature
#[clap(author, version, about, long_about = None)]
struct Cli {
#[clap(short = 'f', action)]
diff --git a/vendor/clap/examples/escaped-positional.md b/vendor/clap-3.2.20/examples/escaped-positional.md
index 1f71a8736..987b26139 100644
--- a/vendor/clap/examples/escaped-positional.md
+++ b/vendor/clap-3.2.20/examples/escaped-positional.md
@@ -1,6 +1,4 @@
-*Jump to [source](escaped-positional.rs)*
-
-**This requires enabling the `cargo` feature flag.**
+**This requires enabling the [`cargo` feature flag][crate::_features].**
You can use `--` to escape further arguments.
diff --git a/vendor/clap/examples/escaped-positional.rs b/vendor/clap-3.2.20/examples/escaped-positional.rs
index a0fff790b..fdcb930fb 100644
--- a/vendor/clap/examples/escaped-positional.rs
+++ b/vendor/clap-3.2.20/examples/escaped-positional.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `cargo` feature
-
use clap::{arg, command, value_parser, ArgAction};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.arg(arg!(eff: -f).action(ArgAction::SetTrue))
.arg(
arg!(pea: -p <PEAR>)
@@ -22,10 +20,7 @@ fn main() {
// This is what will happen with `myprog -f -p=bob -- sloppy slop slop`...
// -f used: true
- println!(
- "-f used: {:?}",
- *matches.get_one::<bool>("eff").expect("defaulted by clap")
- );
+ println!("-f used: {:?}", matches.get_flag("eff"));
// -p's value: Some("bob")
println!("-p's value: {:?}", matches.get_one::<String>("pea"));
// 'slops' values: Some(["sloppy", "slop", "slop"])
diff --git a/vendor/clap/examples/git-derive.md b/vendor/clap-3.2.20/examples/git-derive.md
index dc27776f5..aa1ca6d9d 100644
--- a/vendor/clap/examples/git-derive.md
+++ b/vendor/clap-3.2.20/examples/git-derive.md
@@ -1,6 +1,4 @@
-*Jump to [source](git-derive.rs)*
-
-**This requires enabling the `derive` feature flag.**
+**This requires enabling the [`derive` feature flag][crate::_features].**
Git is an example of several common subcommand patterns.
diff --git a/vendor/clap/examples/git-derive.rs b/vendor/clap-3.2.20/examples/git-derive.rs
index ecbda3fe9..ac500ddad 100644
--- a/vendor/clap/examples/git-derive.rs
+++ b/vendor/clap-3.2.20/examples/git-derive.rs
@@ -1,12 +1,10 @@
-// Note: this requires the `derive` feature
-
use std::ffi::OsString;
use std::path::PathBuf;
use clap::{Args, Parser, Subcommand};
/// A fictional versioning CLI
-#[derive(Debug, Parser)]
+#[derive(Debug, Parser)] // requires `derive` feature
#[clap(name = "git")]
#[clap(about = "A fictional versioning CLI", long_about = None)]
struct Cli {
diff --git a/vendor/clap/examples/git.md b/vendor/clap-3.2.20/examples/git.md
index 2cdfe653b..9e413415a 100644
--- a/vendor/clap/examples/git.md
+++ b/vendor/clap-3.2.20/examples/git.md
@@ -1,5 +1,3 @@
-*Jump to [source](git.rs)*
-
Git is an example of several common subcommand patterns.
Help:
diff --git a/vendor/clap-3.2.20/examples/git.rs b/vendor/clap-3.2.20/examples/git.rs
new file mode 100644
index 000000000..e56f427a6
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/git.rs
@@ -0,0 +1,101 @@
+use std::ffi::OsString;
+use std::path::PathBuf;
+
+use clap::{arg, Command};
+
+fn cli() -> Command<'static> {
+ Command::new("git")
+ .about("A fictional versioning CLI")
+ .subcommand_required(true)
+ .arg_required_else_help(true)
+ .allow_external_subcommands(true)
+ .allow_invalid_utf8_for_external_subcommands(true)
+ .subcommand(
+ Command::new("clone")
+ .about("Clones repos")
+ .arg(arg!(<REMOTE> "The remote to clone"))
+ .arg_required_else_help(true),
+ )
+ .subcommand(
+ Command::new("push")
+ .about("pushes things")
+ .arg(arg!(<REMOTE> "The remote to target"))
+ .arg_required_else_help(true),
+ )
+ .subcommand(
+ Command::new("add")
+ .about("adds things")
+ .arg_required_else_help(true)
+ .arg(arg!(<PATH> ... "Stuff to add").value_parser(clap::value_parser!(PathBuf))),
+ )
+ .subcommand(
+ Command::new("stash")
+ .args_conflicts_with_subcommands(true)
+ .args(push_args())
+ .subcommand(Command::new("push").args(push_args()))
+ .subcommand(Command::new("pop").arg(arg!([STASH])))
+ .subcommand(Command::new("apply").arg(arg!([STASH]))),
+ )
+}
+
+fn push_args() -> Vec<clap::Arg<'static>> {
+ vec![arg!(-m --message <MESSAGE>).required(false)]
+}
+
+fn main() {
+ let matches = cli().get_matches();
+
+ match matches.subcommand() {
+ Some(("clone", sub_matches)) => {
+ println!(
+ "Cloning {}",
+ sub_matches.get_one::<String>("REMOTE").expect("required")
+ );
+ }
+ Some(("push", sub_matches)) => {
+ println!(
+ "Pushing to {}",
+ sub_matches.get_one::<String>("REMOTE").expect("required")
+ );
+ }
+ Some(("add", sub_matches)) => {
+ let paths = sub_matches
+ .get_many::<PathBuf>("PATH")
+ .into_iter()
+ .flatten()
+ .collect::<Vec<_>>();
+ println!("Adding {:?}", paths);
+ }
+ Some(("stash", sub_matches)) => {
+ let stash_command = sub_matches.subcommand().unwrap_or(("push", sub_matches));
+ match stash_command {
+ ("apply", sub_matches) => {
+ let stash = sub_matches.get_one::<String>("STASH");
+ println!("Applying {:?}", stash);
+ }
+ ("pop", sub_matches) => {
+ let stash = sub_matches.get_one::<String>("STASH");
+ println!("Popping {:?}", stash);
+ }
+ ("push", sub_matches) => {
+ let message = sub_matches.get_one::<String>("message");
+ println!("Pushing {:?}", message);
+ }
+ (name, _) => {
+ unreachable!("Unsupported subcommand `{}`", name)
+ }
+ }
+ }
+ Some((ext, sub_matches)) => {
+ let args = sub_matches
+ .get_many::<OsString>("")
+ .into_iter()
+ .flatten()
+ .collect::<Vec<_>>();
+ println!("Calling out to {:?} with {:?}", ext, args);
+ }
+ _ => unreachable!(), // If all subcommands are defined above, anything else is unreachabe!()
+ }
+
+ // Continued program logic goes here...
+}
diff --git a/vendor/clap/examples/multicall-busybox.md b/vendor/clap-3.2.20/examples/multicall-busybox.md
index a09418403..5ca2cad5b 100644
--- a/vendor/clap/examples/multicall-busybox.md
+++ b/vendor/clap-3.2.20/examples/multicall-busybox.md
@@ -1,8 +1,4 @@
-*Jump to [source](multicall-busybox.rs)*
-
-Example of a busybox-style multicall program
-
-See the documentation for `clap::Command::multicall` for rationale.
+See the documentation for [`Command::multicall`][crate::App::multicall] for rationale.
This example omits every command except true and false,
which are the most trivial to implement,
diff --git a/vendor/clap/examples/multicall-busybox.rs b/vendor/clap-3.2.20/examples/multicall-busybox.rs
index 2e7f976c1..2e7f976c1 100644
--- a/vendor/clap/examples/multicall-busybox.rs
+++ b/vendor/clap-3.2.20/examples/multicall-busybox.rs
diff --git a/vendor/clap-3.2.20/examples/multicall-hostname.md b/vendor/clap-3.2.20/examples/multicall-hostname.md
new file mode 100644
index 000000000..d22b85fba
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/multicall-hostname.md
@@ -0,0 +1,10 @@
+See the documentation for [`Command::multicall`][crate::App::multicall] for rationale.
+
+This example omits the implementation of displaying address config
+
+```console
+$ hostname
+www
+
+```
+*Note: without the links setup, we can't demonstrate the multicall behavior*
diff --git a/vendor/clap/examples/multicall-hostname.rs b/vendor/clap-3.2.20/examples/multicall-hostname.rs
index b57680a5c..b57680a5c 100644
--- a/vendor/clap/examples/multicall-hostname.rs
+++ b/vendor/clap-3.2.20/examples/multicall-hostname.rs
diff --git a/vendor/clap/examples/pacman.md b/vendor/clap-3.2.20/examples/pacman.md
index 7f6c5a7d3..b8ddd09d9 100644
--- a/vendor/clap/examples/pacman.md
+++ b/vendor/clap-3.2.20/examples/pacman.md
@@ -1,5 +1,3 @@
-*Jump to [source](pacman.rs)*
-
[`pacman`](https://wiki.archlinux.org/index.php/pacman) defines subcommands via flags.
Here, `-S` is a short flag subcommand:
diff --git a/vendor/clap-3.2.20/examples/pacman.rs b/vendor/clap-3.2.20/examples/pacman.rs
new file mode 100644
index 000000000..aee7cd892
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/pacman.rs
@@ -0,0 +1,111 @@
+use clap::{Arg, ArgAction, Command};
+
+fn main() {
+ let matches = Command::new("pacman")
+ .about("package manager utility")
+ .version("5.2.1")
+ .subcommand_required(true)
+ .arg_required_else_help(true)
+ .author("Pacman Development Team")
+ // Query subcommand
+ //
+ // Only a few of its arguments are implemented below.
+ .subcommand(
+ Command::new("query")
+ .short_flag('Q')
+ .long_flag("query")
+ .about("Query the package database.")
+ .arg(
+ Arg::new("search")
+ .short('s')
+ .long("search")
+ .help("search locally installed packages for matching strings")
+ .conflicts_with("info")
+ .takes_value(true)
+ .multiple_values(true),
+ )
+ .arg(
+ Arg::new("info")
+ .long("info")
+ .short('i')
+ .conflicts_with("search")
+ .help("view package information")
+ .takes_value(true)
+ .multiple_values(true),
+ ),
+ )
+ // Sync subcommand
+ //
+ // Only a few of its arguments are implemented below.
+ .subcommand(
+ Command::new("sync")
+ .short_flag('S')
+ .long_flag("sync")
+ .about("Synchronize packages.")
+ .arg(
+ Arg::new("search")
+ .short('s')
+ .long("search")
+ .conflicts_with("info")
+ .takes_value(true)
+ .multiple_values(true)
+ .help("search remote repositories for matching strings"),
+ )
+ .arg(
+ Arg::new("info")
+ .long("info")
+ .conflicts_with("search")
+ .short('i')
+ .action(ArgAction::SetTrue)
+ .help("view package information"),
+ )
+ .arg(
+ Arg::new("package")
+ .help("packages")
+ .required_unless_present("search")
+ .takes_value(true)
+ .multiple_values(true),
+ ),
+ )
+ .get_matches();
+
+ match matches.subcommand() {
+ Some(("sync", sync_matches)) => {
+ if sync_matches.contains_id("search") {
+ let packages: Vec<_> = sync_matches
+ .get_many::<String>("search")
+ .expect("contains_id")
+ .map(|s| s.as_str())
+ .collect();
+ let values = packages.join(", ");
+ println!("Searching for {}...", values);
+ return;
+ }
+
+ let packages: Vec<_> = sync_matches
+ .get_many::<String>("package")
+ .expect("is present")
+ .map(|s| s.as_str())
+ .collect();
+ let values = packages.join(", ");
+
+ if sync_matches.get_flag("info") {
+ println!("Retrieving info for {}...", values);
+ } else {
+ println!("Installing {}...", values);
+ }
+ }
+ Some(("query", query_matches)) => {
+ if let Some(packages) = query_matches.get_many::<String>("info") {
+ let comma_sep = packages.map(|s| s.as_str()).collect::<Vec<_>>().join(", ");
+ println!("Retrieving info for {}...", comma_sep);
+ } else if let Some(queries) = query_matches.get_many::<String>("search") {
+ let comma_sep = queries.map(|s| s.as_str()).collect::<Vec<_>>().join(", ");
+ println!("Searching Locally for {}...", comma_sep);
+ } else {
+ println!("Displaying all locally installed packages...");
+ }
+ }
+ _ => unreachable!(), // If all subcommands are defined above, anything else is unreachable
+ }
+}
diff --git a/vendor/clap/examples/repl.rs b/vendor/clap-3.2.20/examples/repl.rs
index c509adee6..c509adee6 100644
--- a/vendor/clap/examples/repl.rs
+++ b/vendor/clap-3.2.20/examples/repl.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/01_quick.md b/vendor/clap-3.2.20/examples/tutorial_builder/01_quick.md
new file mode 100644
index 000000000..4a9e3fca1
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/01_quick.md
@@ -0,0 +1,37 @@
+```console
+$ 01_quick --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 01_quick[EXE] [OPTIONS] [name] [SUBCOMMAND]
+
+ARGS:
+ <name> Optional name to operate on
+
+OPTIONS:
+ -c, --config <FILE> Sets a custom config file
+ -d, --debug Turn debugging information on
+ -h, --help Print help information
+ -V, --version Print version information
+
+SUBCOMMANDS:
+ help Print this message or the help of the given subcommand(s)
+ test does testing things
+
+```
+
+By default, the program does nothing:
+```console
+$ 01_quick
+Debug mode is off
+
+```
+
+But you can mix and match the various features
+```console
+$ 01_quick -dd test
+Debug mode is on
+Not printing testing lists...
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/01_quick.rs b/vendor/clap-3.2.20/examples/tutorial_builder/01_quick.rs
index 61cc3432d..393d6aeae 100644
--- a/vendor/clap/examples/tutorial_builder/01_quick.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/01_quick.rs
@@ -1,11 +1,9 @@
-// Note: this requires the `cargo` feature
-
use std::path::PathBuf;
use clap::{arg, command, value_parser, ArgAction, Command};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.arg(arg!([name] "Optional name to operate on"))
.arg(
arg!(
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.md b/vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.md
new file mode 100644
index 000000000..247843bcf
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.md
@@ -0,0 +1,19 @@
+```console
+$ 02_app_settings --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 02_app_settings[EXE] --two <VALUE> --one <VALUE>
+
+OPTIONS:
+ --two <VALUE>
+ --one <VALUE>
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 02_app_settings --one -1 --one -3 --two 10
+two: "10"
+one: "-3"
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/02_app_settings.rs b/vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.rs
index 7bbedd3eb..5f374d7f0 100644
--- a/vendor/clap/examples/tutorial_builder/02_app_settings.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/02_app_settings.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `cargo` feature
-
use clap::{arg, command, AppSettings, ArgAction};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.global_setting(AppSettings::DeriveDisplayOrder)
.allow_negative_numbers(true)
.arg(arg!(--two <VALUE>).action(ArgAction::Set))
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/02_apps.md b/vendor/clap-3.2.20/examples/tutorial_builder/02_apps.md
new file mode 100644
index 000000000..8504b5f52
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/02_apps.md
@@ -0,0 +1,19 @@
+```console
+$ 02_apps --help
+MyApp 1.0
+Kevin K. <kbknapp@gmail.com>
+Does awesome things
+
+USAGE:
+ 02_apps[EXE] --two <VALUE> --one <VALUE>
+
+OPTIONS:
+ -h, --help Print help information
+ --one <VALUE>
+ --two <VALUE>
+ -V, --version Print version information
+
+$ 02_apps --version
+MyApp 1.0
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/02_apps.rs b/vendor/clap-3.2.20/examples/tutorial_builder/02_apps.rs
index db9da18f9..db9da18f9 100644
--- a/vendor/clap/examples/tutorial_builder/02_apps.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/02_apps.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/02_crate.md b/vendor/clap-3.2.20/examples/tutorial_builder/02_crate.md
new file mode 100644
index 000000000..f76e0d608
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/02_crate.md
@@ -0,0 +1,18 @@
+```console
+$ 02_crate --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 02_crate[EXE] --two <VALUE> --one <VALUE>
+
+OPTIONS:
+ -h, --help Print help information
+ --one <VALUE>
+ --two <VALUE>
+ -V, --version Print version information
+
+$ 02_crate --version
+clap [..]
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/02_crate.rs b/vendor/clap-3.2.20/examples/tutorial_builder/02_crate.rs
new file mode 100644
index 000000000..8a1722fd3
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/02_crate.rs
@@ -0,0 +1,18 @@
+use clap::{arg, command};
+
+fn main() {
+ // requires `cargo` feature, reading name, version, author, and description from `Cargo.toml`
+ let matches = command!()
+ .arg(arg!(--two <VALUE>))
+ .arg(arg!(--one <VALUE>))
+ .get_matches();
+
+ println!(
+ "two: {:?}",
+ matches.get_one::<String>("two").expect("required")
+ );
+ println!(
+ "one: {:?}",
+ matches.get_one::<String>("one").expect("required")
+ );
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.md b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.md
new file mode 100644
index 000000000..b0ee2a126
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.md
@@ -0,0 +1,23 @@
+```console
+$ 03_01_flag_bool --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_01_flag_bool[EXE] [OPTIONS]
+
+OPTIONS:
+ -h, --help Print help information
+ -v, --verbose
+ -V, --version Print version information
+
+$ 03_01_flag_bool
+verbose: false
+
+$ 03_01_flag_bool --verbose
+verbose: true
+
+$ 03_01_flag_bool --verbose --verbose
+verbose: true
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.rs b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.rs
new file mode 100644
index 000000000..03f2f1756
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_bool.rs
@@ -0,0 +1,14 @@
+use clap::{command, Arg, ArgAction};
+
+fn main() {
+ let matches = command!() // requires `cargo` feature
+ .arg(
+ Arg::new("verbose")
+ .short('v')
+ .long("verbose")
+ .action(ArgAction::SetTrue),
+ )
+ .get_matches();
+
+ println!("verbose: {:?}", matches.get_flag("verbose"));
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.md b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.md
new file mode 100644
index 000000000..ca4bcd6eb
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.md
@@ -0,0 +1,23 @@
+```console
+$ 03_01_flag_count --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_01_flag_count[EXE] [OPTIONS]
+
+OPTIONS:
+ -h, --help Print help information
+ -v, --verbose
+ -V, --version Print version information
+
+$ 03_01_flag_count
+verbose: 0
+
+$ 03_01_flag_count --verbose
+verbose: 1
+
+$ 03_01_flag_count --verbose --verbose
+verbose: 2
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.rs b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.rs
new file mode 100644
index 000000000..7f23649d6
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_01_flag_count.rs
@@ -0,0 +1,9 @@
+use clap::{arg, command, ArgAction};
+
+fn main() {
+ let matches = command!() // requires `cargo` feature
+ .arg(arg!(-v - -verbose).action(ArgAction::Count))
+ .get_matches();
+
+ println!("verbose: {:?}", matches.get_count("verbose"));
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.md b/vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.md
new file mode 100644
index 000000000..6198bcc73
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.md
@@ -0,0 +1,32 @@
+```console
+$ 03_02_option --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_02_option[EXE] [OPTIONS]
+
+OPTIONS:
+ -h, --help Print help information
+ -n, --name <NAME>
+ -V, --version Print version information
+
+$ 03_02_option
+name: None
+
+$ 03_02_option --name bob
+name: Some("bob")
+
+$ 03_02_option --name=bob
+name: Some("bob")
+
+$ 03_02_option -n bob
+name: Some("bob")
+
+$ 03_02_option -n=bob
+name: Some("bob")
+
+$ 03_02_option -nbob
+name: Some("bob")
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.rs b/vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.rs
new file mode 100644
index 000000000..188244566
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_02_option.rs
@@ -0,0 +1,9 @@
+use clap::{arg, command};
+
+fn main() {
+ let matches = command!() // requires `cargo` feature
+ .arg(arg!(-n --name <NAME>).required(false))
+ .get_matches();
+
+ println!("name: {:?}", matches.get_one::<String>("name"));
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.md b/vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.md
new file mode 100644
index 000000000..a3d7b8cf3
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.md
@@ -0,0 +1,22 @@
+```console
+$ 03_03_positional --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_03_positional[EXE] [NAME]
+
+ARGS:
+ <NAME>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 03_03_positional
+NAME: None
+
+$ 03_03_positional bob
+NAME: Some("bob")
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.rs b/vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.rs
new file mode 100644
index 000000000..0c3a5f037
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_03_positional.rs
@@ -0,0 +1,9 @@
+use clap::{arg, command};
+
+fn main() {
+ let matches = command!() // requires `cargo` feature
+ .arg(arg!([NAME]))
+ .get_matches();
+
+ println!("NAME: {:?}", matches.get_one::<String>("NAME"));
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.md b/vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.md
new file mode 100644
index 000000000..8f9efa911
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.md
@@ -0,0 +1,64 @@
+```console
+$ 03_04_subcommands help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_04_subcommands[EXE] <SUBCOMMAND>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+SUBCOMMANDS:
+ add Adds files to myapp
+ help Print this message or the help of the given subcommand(s)
+
+$ 03_04_subcommands help add
+03_04_subcommands[EXE]-add [..]
+Adds files to myapp
+
+USAGE:
+ 03_04_subcommands[EXE] add [NAME]
+
+ARGS:
+ <NAME>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 03_04_subcommands add bob
+'myapp add' was used, name is: Some("bob")
+
+```
+
+Because we set [`Command::arg_required_else_help`][crate::Command::arg_required_else_help]:
+```console
+$ 03_04_subcommands
+? failed
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_04_subcommands[EXE] <SUBCOMMAND>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+SUBCOMMANDS:
+ add Adds files to myapp
+ help Print this message or the help of the given subcommand(s)
+
+```
+
+Because we set [`Command::propagate_version`][crate::Command::propagate_version]:
+```console
+$ 03_04_subcommands --version
+clap [..]
+
+$ 03_04_subcommands add --version
+03_04_subcommands[EXE]-add [..]
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/03_04_subcommands.rs b/vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.rs
index 1dd1cbf09..fbe23809e 100644
--- a/vendor/clap/examples/tutorial_builder/03_04_subcommands.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_04_subcommands.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `cargo` feature
-
use clap::{arg, command, Command};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.propagate_version(true)
.subcommand_required(true)
.arg_required_else_help(true)
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.md b/vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.md
new file mode 100644
index 000000000..7b6c0307d
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.md
@@ -0,0 +1,22 @@
+```console
+$ 03_05_default_values --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_05_default_values[EXE] [NAME]
+
+ARGS:
+ <NAME> [default: alice]
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 03_05_default_values
+NAME: "alice"
+
+$ 03_05_default_values bob
+NAME: "bob"
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/03_05_default_values.rs b/vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.rs
index c68e87973..cb3e3831f 100644
--- a/vendor/clap/examples/tutorial_builder/03_05_default_values.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/03_05_default_values.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `cargo` feature
-
use clap::{arg, command};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.arg(arg!([NAME]).default_value("alice"))
.get_matches();
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.md b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.md
new file mode 100644
index 000000000..282b1e613
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.md
@@ -0,0 +1,29 @@
+```console
+$ 04_01_enum --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_01_enum[EXE] <MODE>
+
+ARGS:
+ <MODE> What mode to run the program in [possible values: fast, slow]
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_01_enum fast
+Hare
+
+$ 04_01_enum slow
+Tortoise
+
+$ 04_01_enum medium
+? failed
+error: "medium" isn't a valid value for '<MODE>'
+ [possible values: fast, slow]
+
+For more information try --help
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.rs b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.rs
new file mode 100644
index 000000000..e8cf70f5c
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_enum.rs
@@ -0,0 +1,66 @@
+use clap::{arg, builder::PossibleValue, command, value_parser, ValueEnum};
+
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
+enum Mode {
+ Fast,
+ Slow,
+}
+
+// Can also be derived] with feature flag `derive`
+impl ValueEnum for Mode {
+ fn value_variants<'a>() -> &'a [Self] {
+ &[Mode::Fast, Mode::Slow]
+ }
+
+ fn to_possible_value<'a>(&self) -> Option<PossibleValue<'a>> {
+ Some(match self {
+ Mode::Fast => PossibleValue::new("fast"),
+ Mode::Slow => PossibleValue::new("slow"),
+ })
+ }
+}
+
+impl std::fmt::Display for Mode {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ self.to_possible_value()
+ .expect("no values are skipped")
+ .get_name()
+ .fmt(f)
+ }
+}
+
+impl std::str::FromStr for Mode {
+ type Err = String;
+
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
+ for variant in Self::value_variants() {
+ if variant.to_possible_value().unwrap().matches(s, false) {
+ return Ok(*variant);
+ }
+ }
+ Err(format!("Invalid variant: {}", s))
+ }
+}
+
+fn main() {
+ let matches = command!() // requires `cargo` feature
+ .arg(
+ arg!(<MODE>)
+ .help("What mode to run the program in")
+ .value_parser(value_parser!(Mode)),
+ )
+ .get_matches();
+
+ // Note, it's safe to call unwrap() because the arg is required
+ match matches
+ .get_one::<Mode>("MODE")
+ .expect("'MODE' is required and parsing will fail if its missing")
+ {
+ Mode::Fast => {
+ println!("Hare");
+ }
+ Mode::Slow => {
+ println!("Tortoise");
+ }
+ }
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.md b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.md
new file mode 100644
index 000000000..2909bfb17
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.md
@@ -0,0 +1,29 @@
+```console
+$ 04_01_possible --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_01_possible[EXE] <MODE>
+
+ARGS:
+ <MODE> What mode to run the program in [possible values: fast, slow]
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_01_possible fast
+Hare
+
+$ 04_01_possible slow
+Tortoise
+
+$ 04_01_possible medium
+? failed
+error: "medium" isn't a valid value for '<MODE>'
+ [possible values: fast, slow]
+
+For more information try --help
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/04_01_possible.rs b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.rs
index f7b0cfb34..3da7aca74 100644
--- a/vendor/clap/examples/tutorial_builder/04_01_possible.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_01_possible.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `cargo` feature
-
use clap::{arg, command};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.arg(
arg!(<MODE>)
.help("What mode to run the program in")
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.md b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.md
new file mode 100644
index 000000000..605bf4b59
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.md
@@ -0,0 +1,31 @@
+```console
+$ 04_02_parse --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_02_parse[EXE] <PORT>
+
+ARGS:
+ <PORT> Network port to use
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_02_parse 22
+PORT = 22
+
+$ 04_02_parse foobar
+? failed
+error: Invalid value "foobar" for '<PORT>': invalid digit found in string
+
+For more information try --help
+
+$ 04_02_parse_derive 0
+? failed
+error: Invalid value "0" for '<PORT>': 0 is not in 1..=65535
+
+For more information try --help
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/04_02_parse.rs b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.rs
index c2f3cc533..13f41a18e 100644
--- a/vendor/clap/examples/tutorial_builder/04_02_parse.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_parse.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `cargo` feature
-
use clap::{arg, command, value_parser};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.arg(
arg!(<PORT>)
.help("Network port to use")
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.md b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.md
new file mode 100644
index 000000000..a317a8eb7
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.md
@@ -0,0 +1,31 @@
+```console
+$ 04_02_validate --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_02_validate[EXE] <PORT>
+
+ARGS:
+ <PORT> Network port to use
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_02_validate 22
+PORT = 22
+
+$ 04_02_validate foobar
+? failed
+error: Invalid value "foobar" for '<PORT>': `foobar` isn't a port number
+
+For more information try --help
+
+$ 04_02_validate 0
+? failed
+error: Invalid value "0" for '<PORT>': Port not in range 1-65535
+
+For more information try --help
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/04_02_validate.rs b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.rs
index e60018a46..ea2f32e67 100644
--- a/vendor/clap/examples/tutorial_builder/04_02_validate.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_02_validate.rs
@@ -1,11 +1,9 @@
-// Note: this requires the `cargo` feature
-
use std::ops::RangeInclusive;
use clap::{arg, command};
fn main() {
- let matches = command!()
+ let matches = command!() // requires `cargo` feature
.arg(
arg!(<PORT>)
.help("Network port to use")
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.md b/vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.md
new file mode 100644
index 000000000..3ea336363
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.md
@@ -0,0 +1,58 @@
+```console
+$ 04_03_relations --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_03_relations[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
+
+ARGS:
+ <INPUT_FILE> some regular input
+
+OPTIONS:
+ -c <CONFIG>
+ -h, --help Print help information
+ --major auto inc major
+ --minor auto inc minor
+ --patch auto inc patch
+ --set-ver <VER> set version manually
+ --spec-in <SPEC_IN> some special input argument
+ -V, --version Print version information
+
+$ 04_03_relations
+? failed
+error: The following required arguments were not provided:
+ <--set-ver <VER>|--major|--minor|--patch>
+
+USAGE:
+ 04_03_relations[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
+
+For more information try --help
+
+$ 04_03_relations --major
+Version: 2.2.3
+
+$ 04_03_relations --major --minor
+? failed
+error: The argument '--major' cannot be used with '--minor'
+
+USAGE:
+ 04_03_relations[EXE] <--set-ver <VER>|--major|--minor|--patch>
+
+For more information try --help
+
+$ 04_03_relations --major -c config.toml
+? failed
+error: The following required arguments were not provided:
+ <INPUT_FILE|--spec-in <SPEC_IN>>
+
+USAGE:
+ 04_03_relations[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
+
+For more information try --help
+
+$ 04_03_relations --major -c config.toml --spec-in input.txt
+Version: 2.2.3
+Doing work using input input.txt and config config.toml
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.rs b/vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.rs
new file mode 100644
index 000000000..8e26d3ea9
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_03_relations.rs
@@ -0,0 +1,80 @@
+use std::path::PathBuf;
+
+use clap::{arg, command, value_parser, ArgAction, ArgGroup};
+
+fn main() {
+ // Create application like normal
+ let matches = command!() // requires `cargo` feature
+ // Add the version arguments
+ .arg(arg!(--"set-ver" <VER> "set version manually").required(false))
+ .arg(arg!(--major "auto inc major").action(ArgAction::SetTrue))
+ .arg(arg!(--minor "auto inc minor").action(ArgAction::SetTrue))
+ .arg(arg!(--patch "auto inc patch").action(ArgAction::SetTrue))
+ // Create a group, make it required, and add the above arguments
+ .group(
+ ArgGroup::new("vers")
+ .required(true)
+ .args(&["set-ver", "major", "minor", "patch"]),
+ )
+ // Arguments can also be added to a group individually, these two arguments
+ // are part of the "input" group which is not required
+ .arg(
+ arg!([INPUT_FILE] "some regular input")
+ .value_parser(value_parser!(PathBuf))
+ .group("input"),
+ )
+ .arg(
+ arg!(--"spec-in" <SPEC_IN> "some special input argument")
+ .required(false)
+ .value_parser(value_parser!(PathBuf))
+ .group("input"),
+ )
+ // Now let's assume we have a -c [config] argument which requires one of
+ // (but **not** both) the "input" arguments
+ .arg(
+ arg!(config: -c <CONFIG>)
+ .required(false)
+ .value_parser(value_parser!(PathBuf))
+ .requires("input"),
+ )
+ .get_matches();
+
+ // Let's assume the old version 1.2.3
+ let mut major = 1;
+ let mut minor = 2;
+ let mut patch = 3;
+
+ // See if --set-ver was used to set the version manually
+ let version = if let Some(ver) = matches.get_one::<String>("set-ver") {
+ ver.to_owned()
+ } else {
+ // Increment the one requested (in a real program, we'd reset the lower numbers)
+ let (maj, min, pat) = (
+ matches.get_flag("major"),
+ matches.get_flag("minor"),
+ matches.get_flag("patch"),
+ );
+ match (maj, min, pat) {
+ (true, _, _) => major += 1,
+ (_, true, _) => minor += 1,
+ (_, _, true) => patch += 1,
+ _ => unreachable!(),
+ };
+ format!("{}.{}.{}", major, minor, patch)
+ };
+
+ println!("Version: {}", version);
+
+ // Check for usage of -c
+ if matches.contains_id("config") {
+ let input = matches
+ .get_one::<PathBuf>("INPUT_FILE")
+ .unwrap_or_else(|| matches.get_one::<PathBuf>("spec-in").unwrap())
+ .display();
+ println!(
+ "Doing work using input {} and config {}",
+ input,
+ matches.get_one::<PathBuf>("config").unwrap().display()
+ );
+ }
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.md b/vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.md
new file mode 100644
index 000000000..26a3df1ab
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.md
@@ -0,0 +1,57 @@
+```console
+$ 04_04_custom --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
+
+ARGS:
+ <INPUT_FILE> some regular input
+
+OPTIONS:
+ -c <CONFIG>
+ -h, --help Print help information
+ --major auto inc major
+ --minor auto inc minor
+ --patch auto inc patch
+ --set-ver <VER> set version manually
+ --spec-in <SPEC_IN> some special input argument
+ -V, --version Print version information
+
+$ 04_04_custom
+? failed
+error: Can only modify one version field
+
+USAGE:
+ 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
+
+For more information try --help
+
+$ 04_04_custom --major
+Version: 2.2.3
+
+$ 04_04_custom --major --minor
+? failed
+error: Can only modify one version field
+
+USAGE:
+ 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
+
+For more information try --help
+
+$ 04_04_custom --major -c config.toml
+? failed
+Version: 2.2.3
+error: INPUT_FILE or --spec-in is required when using --config
+
+USAGE:
+ 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
+
+For more information try --help
+
+$ 04_04_custom --major -c config.toml --spec-in input.txt
+Version: 2.2.3
+Doing work using input input.txt and config config.toml
+
+```
diff --git a/vendor/clap/examples/tutorial_builder/04_04_custom.rs b/vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.rs
index 3dc080505..fb40b2fc4 100644
--- a/vendor/clap/examples/tutorial_builder/04_04_custom.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/04_04_custom.rs
@@ -1,12 +1,10 @@
-// Note: this requires the `cargo` feature
-
use std::path::PathBuf;
use clap::{arg, command, value_parser, ArgAction, ErrorKind};
fn main() {
// Create application like normal
- let mut cmd = command!()
+ let mut cmd = command!() // requires `cargo` feature
// Add the version arguments
.arg(arg!(--"set-ver" <VER> "set version manually").required(false))
.arg(arg!(--major "auto inc major").action(ArgAction::SetTrue))
@@ -36,10 +34,7 @@ fn main() {
// See if --set-ver was used to set the version manually
let version = if let Some(ver) = matches.get_one::<String>("set-ver") {
- if *matches.get_one::<bool>("major").expect("defaulted by clap")
- || *matches.get_one::<bool>("minor").expect("defaulted by clap")
- || *matches.get_one::<bool>("patch").expect("defaulted by clap")
- {
+ if matches.get_flag("major") || matches.get_flag("minor") || matches.get_flag("patch") {
cmd.error(
ErrorKind::ArgumentConflict,
"Can't do relative and absolute version change",
@@ -50,9 +45,9 @@ fn main() {
} else {
// Increment the one requested (in a real program, we'd reset the lower numbers)
let (maj, min, pat) = (
- *matches.get_one::<bool>("major").expect("defaulted by clap"),
- *matches.get_one::<bool>("minor").expect("defaulted by clap"),
- *matches.get_one::<bool>("patch").expect("defaulted by clap"),
+ matches.get_flag("major"),
+ matches.get_flag("minor"),
+ matches.get_flag("patch"),
);
match (maj, min, pat) {
(true, false, false) => major += 1,
diff --git a/vendor/clap-3.2.20/examples/tutorial_builder/05_01_assert.rs b/vendor/clap-3.2.20/examples/tutorial_builder/05_01_assert.rs
new file mode 100644
index 000000000..4b9254230
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_builder/05_01_assert.rs
@@ -0,0 +1,25 @@
+use clap::{arg, command, value_parser};
+
+fn main() {
+ let matches = cmd().get_matches();
+
+ // Note, it's safe to call unwrap() because the arg is required
+ let port: usize = *matches
+ .get_one::<usize>("PORT")
+ .expect("'PORT' is required and parsing will fail if its missing");
+ println!("PORT = {}", port);
+}
+
+fn cmd() -> clap::Command<'static> {
+ command!() // requires `cargo` feature
+ .arg(
+ arg!(<PORT>)
+ .help("Network port to use")
+ .value_parser(value_parser!(usize)),
+ )
+}
+
+#[test]
+fn verify_cmd() {
+ cmd().debug_assert();
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/01_quick.md b/vendor/clap-3.2.20/examples/tutorial_derive/01_quick.md
new file mode 100644
index 000000000..6f70d2cce
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/01_quick.md
@@ -0,0 +1,37 @@
+```console
+$ 01_quick_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 01_quick_derive[EXE] [OPTIONS] [NAME] [SUBCOMMAND]
+
+ARGS:
+ <NAME> Optional name to operate on
+
+OPTIONS:
+ -c, --config <FILE> Sets a custom config file
+ -d, --debug Turn debugging information on
+ -h, --help Print help information
+ -V, --version Print version information
+
+SUBCOMMANDS:
+ help Print this message or the help of the given subcommand(s)
+ test does testing things
+
+```
+
+By default, the program does nothing:
+```console
+$ 01_quick_derive
+Debug mode is off
+
+```
+
+But you can mix and match the various features
+```console
+$ 01_quick_derive -dd test
+Debug mode is on
+Not printing testing lists...
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/01_quick.rs b/vendor/clap-3.2.20/examples/tutorial_derive/01_quick.rs
index 2c2031061..2c2031061 100644
--- a/vendor/clap/examples/tutorial_derive/01_quick.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/01_quick.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.md b/vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.md
new file mode 100644
index 000000000..ee16c66df
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.md
@@ -0,0 +1,19 @@
+```console
+$ 02_app_settings_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 02_app_settings_derive[EXE] --two <TWO> --one <ONE>
+
+OPTIONS:
+ --two <TWO>
+ --one <ONE>
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 02_app_settings_derive --one -1 --one -3 --two 10
+two: "10"
+one: "-3"
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/02_app_settings.rs b/vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.rs
index 6a06929bb..6a06929bb 100644
--- a/vendor/clap/examples/tutorial_derive/02_app_settings.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_app_settings.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/02_apps.md b/vendor/clap-3.2.20/examples/tutorial_derive/02_apps.md
new file mode 100644
index 000000000..0141581c4
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_apps.md
@@ -0,0 +1,19 @@
+```console
+$ 02_apps_derive --help
+MyApp 1.0
+Kevin K. <kbknapp@gmail.com>
+Does awesome things
+
+USAGE:
+ 02_apps_derive[EXE] --two <TWO> --one <ONE>
+
+OPTIONS:
+ -h, --help Print help information
+ --one <ONE>
+ --two <TWO>
+ -V, --version Print version information
+
+$ 02_apps_derive --version
+MyApp 1.0
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/02_apps.rs b/vendor/clap-3.2.20/examples/tutorial_derive/02_apps.rs
index b97ce1eed..b97ce1eed 100644
--- a/vendor/clap/examples/tutorial_derive/02_apps.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_apps.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.md b/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.md
new file mode 100644
index 000000000..92c820758
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.md
@@ -0,0 +1,18 @@
+```console
+$ 02_crate_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 02_crate_derive[EXE] --two <TWO> --one <ONE>
+
+OPTIONS:
+ -h, --help Print help information
+ --one <ONE>
+ --two <TWO>
+ -V, --version Print version information
+
+$ 02_crate_derive --version
+clap [..]
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs b/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs
new file mode 100644
index 000000000..5576f998c
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/02_crate.rs
@@ -0,0 +1,17 @@
+use clap::Parser;
+
+#[derive(Parser)]
+#[clap(author, version, about, long_about = None)] // Read from `Cargo.toml`
+struct Cli {
+ #[clap(long, value_parser)]
+ two: String,
+ #[clap(long, value_parser)]
+ one: String,
+}
+
+fn main() {
+ let cli = Cli::parse();
+
+ println!("two: {:?}", cli.two);
+ println!("one: {:?}", cli.one);
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.md b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.md
new file mode 100644
index 000000000..0baaa10ca
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.md
@@ -0,0 +1,23 @@
+```console
+$ 03_01_flag_bool_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_01_flag_bool_derive[EXE] [OPTIONS]
+
+OPTIONS:
+ -h, --help Print help information
+ -v, --verbose
+ -V, --version Print version information
+
+$ 03_01_flag_bool_derive
+verbose: false
+
+$ 03_01_flag_bool_derive --verbose
+verbose: true
+
+$ 03_01_flag_bool_derive --verbose --verbose
+verbose: true
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.rs
index de677d8c6..de677d8c6 100644
--- a/vendor/clap/examples/tutorial_derive/03_01_flag_bool.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_bool.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.md b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.md
new file mode 100644
index 000000000..3d5a53084
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.md
@@ -0,0 +1,23 @@
+```console
+$ 03_01_flag_count_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_01_flag_count_derive[EXE] [OPTIONS]
+
+OPTIONS:
+ -h, --help Print help information
+ -v, --verbose
+ -V, --version Print version information
+
+$ 03_01_flag_count_derive
+verbose: 0
+
+$ 03_01_flag_count_derive --verbose
+verbose: 1
+
+$ 03_01_flag_count_derive --verbose --verbose
+verbose: 2
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/03_01_flag_count.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.rs
index 680f7f5e5..680f7f5e5 100644
--- a/vendor/clap/examples/tutorial_derive/03_01_flag_count.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_01_flag_count.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.md b/vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.md
new file mode 100644
index 000000000..84ff7fa74
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.md
@@ -0,0 +1,32 @@
+```console
+$ 03_02_option_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_02_option_derive[EXE] [OPTIONS]
+
+OPTIONS:
+ -h, --help Print help information
+ -n, --name <NAME>
+ -V, --version Print version information
+
+$ 03_02_option_derive
+name: None
+
+$ 03_02_option_derive --name bob
+name: Some("bob")
+
+$ 03_02_option_derive --name=bob
+name: Some("bob")
+
+$ 03_02_option_derive -n bob
+name: Some("bob")
+
+$ 03_02_option_derive -n=bob
+name: Some("bob")
+
+$ 03_02_option_derive -nbob
+name: Some("bob")
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/03_02_option.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.rs
index 75b67afe7..75b67afe7 100644
--- a/vendor/clap/examples/tutorial_derive/03_02_option.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_02_option.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.md b/vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.md
new file mode 100644
index 000000000..7281fe3ff
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.md
@@ -0,0 +1,22 @@
+```console
+$ 03_03_positional_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_03_positional_derive[EXE] [NAME]
+
+ARGS:
+ <NAME>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 03_03_positional_derive
+name: None
+
+$ 03_03_positional_derive bob
+name: Some("bob")
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/03_03_positional.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.rs
index 7478951f1..7478951f1 100644
--- a/vendor/clap/examples/tutorial_derive/03_03_positional.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_03_positional.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.md b/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.md
new file mode 100644
index 000000000..02f96e3d3
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.md
@@ -0,0 +1,64 @@
+```console
+$ 03_04_subcommands_derive help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_04_subcommands_derive[EXE] <SUBCOMMAND>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+SUBCOMMANDS:
+ add Adds files to myapp
+ help Print this message or the help of the given subcommand(s)
+
+$ 03_04_subcommands_derive help add
+03_04_subcommands_derive[EXE]-add [..]
+Adds files to myapp
+
+USAGE:
+ 03_04_subcommands_derive[EXE] add [NAME]
+
+ARGS:
+ <NAME>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 03_04_subcommands_derive add bob
+'myapp add' was used, name is: Some("bob")
+
+```
+
+Because we used `command: Commands` instead of `command: Option<Commands>`:
+```console
+$ 03_04_subcommands_derive
+? failed
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_04_subcommands_derive[EXE] <SUBCOMMAND>
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+SUBCOMMANDS:
+ add Adds files to myapp
+ help Print this message or the help of the given subcommand(s)
+
+```
+
+Because we added `#[clap(propagate_version = true)]`:
+```console
+$ 03_04_subcommands_derive --version
+clap [..]
+
+$ 03_04_subcommands_derive add --version
+03_04_subcommands_derive[EXE]-add [..]
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/03_04_subcommands.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.rs
index 62a45a97e..62a45a97e 100644
--- a/vendor/clap/examples/tutorial_derive/03_04_subcommands.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands.rs
diff --git a/vendor/clap/examples/tutorial_derive/03_04_subcommands_alt.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands_alt.rs
index b6124936c..b6124936c 100644
--- a/vendor/clap/examples/tutorial_derive/03_04_subcommands_alt.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_04_subcommands_alt.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.md b/vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.md
new file mode 100644
index 000000000..f7315e736
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.md
@@ -0,0 +1,22 @@
+```console
+$ 03_05_default_values_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 03_05_default_values_derive[EXE] [NAME]
+
+ARGS:
+ <NAME> [default: alice]
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 03_05_default_values_derive
+name: "alice"
+
+$ 03_05_default_values_derive bob
+name: "bob"
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/03_05_default_values.rs b/vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.rs
index 10a1ec808..10a1ec808 100644
--- a/vendor/clap/examples/tutorial_derive/03_05_default_values.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/03_05_default_values.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.md b/vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.md
new file mode 100644
index 000000000..2523af924
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.md
@@ -0,0 +1,29 @@
+```console
+$ 04_01_enum_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_01_enum_derive[EXE] <MODE>
+
+ARGS:
+ <MODE> What mode to run the program in [possible values: fast, slow]
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_01_enum_derive fast
+Hare
+
+$ 04_01_enum_derive slow
+Tortoise
+
+$ 04_01_enum_derive medium
+? failed
+error: "medium" isn't a valid value for '<MODE>'
+ [possible values: fast, slow]
+
+For more information try --help
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.rs b/vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.rs
new file mode 100644
index 000000000..1ac984288
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_01_enum.rs
@@ -0,0 +1,28 @@
+use clap::{Parser, ValueEnum};
+
+#[derive(Parser)]
+#[clap(author, version, about, long_about = None)]
+struct Cli {
+ /// What mode to run the program in
+ #[clap(arg_enum, value_parser)]
+ mode: Mode,
+}
+
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
+enum Mode {
+ Fast,
+ Slow,
+}
+
+fn main() {
+ let cli = Cli::parse();
+
+ match cli.mode {
+ Mode::Fast => {
+ println!("Hare");
+ }
+ Mode::Slow => {
+ println!("Tortoise");
+ }
+ }
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.md b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.md
new file mode 100644
index 000000000..6079ef193
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.md
@@ -0,0 +1,31 @@
+```console
+$ 04_02_parse_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_02_parse_derive[EXE] <PORT>
+
+ARGS:
+ <PORT> Network port to use
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_02_parse_derive 22
+PORT = 22
+
+$ 04_02_parse_derive foobar
+? failed
+error: Invalid value "foobar" for '<PORT>': invalid digit found in string
+
+For more information try --help
+
+$ 04_02_parse_derive 0
+? failed
+error: Invalid value "0" for '<PORT>': 0 is not in 1..=65535
+
+For more information try --help
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/04_02_parse.rs b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.rs
index 6336a9cf1..6336a9cf1 100644
--- a/vendor/clap/examples/tutorial_derive/04_02_parse.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_parse.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.md b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.md
new file mode 100644
index 000000000..cc43440ef
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.md
@@ -0,0 +1,31 @@
+```console
+$ 04_02_validate_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_02_validate_derive[EXE] <PORT>
+
+ARGS:
+ <PORT> Network port to use
+
+OPTIONS:
+ -h, --help Print help information
+ -V, --version Print version information
+
+$ 04_02_validate_derive 22
+PORT = 22
+
+$ 04_02_validate_derive foobar
+? failed
+error: Invalid value "foobar" for '<PORT>': `foobar` isn't a port number
+
+For more information try --help
+
+$ 04_02_validate_derive 0
+? failed
+error: Invalid value "0" for '<PORT>': Port not in range 1-65535
+
+For more information try --help
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/04_02_validate.rs b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.rs
index 7dac79c9f..7dac79c9f 100644
--- a/vendor/clap/examples/tutorial_derive/04_02_validate.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_02_validate.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.md b/vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.md
new file mode 100644
index 000000000..4f5703d82
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.md
@@ -0,0 +1,58 @@
+```console
+$ 04_03_relations_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_03_relations_derive[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
+
+ARGS:
+ <INPUT_FILE> some regular input
+
+OPTIONS:
+ -c <CONFIG>
+ -h, --help Print help information
+ --major auto inc major
+ --minor auto inc minor
+ --patch auto inc patch
+ --set-ver <VER> set version manually
+ --spec-in <SPEC_IN> some special input argument
+ -V, --version Print version information
+
+$ 04_03_relations_derive
+? failed
+error: The following required arguments were not provided:
+ <--set-ver <VER>|--major|--minor|--patch>
+
+USAGE:
+ 04_03_relations_derive[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
+
+For more information try --help
+
+$ 04_03_relations_derive --major
+Version: 2.2.3
+
+$ 04_03_relations_derive --major --minor
+? failed
+error: The argument '--major' cannot be used with '--minor'
+
+USAGE:
+ 04_03_relations_derive[EXE] <--set-ver <VER>|--major|--minor|--patch>
+
+For more information try --help
+
+$ 04_03_relations_derive --major -c config.toml
+? failed
+error: The following required arguments were not provided:
+ <INPUT_FILE|--spec-in <SPEC_IN>>
+
+USAGE:
+ 04_03_relations_derive[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
+
+For more information try --help
+
+$ 04_03_relations_derive --major -c config.toml --spec-in input.txt
+Version: 2.2.3
+Doing work using input input.txt and config config.toml
+
+```
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.rs b/vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.rs
new file mode 100644
index 000000000..37efe95e3
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_03_relations.rs
@@ -0,0 +1,72 @@
+use clap::{ArgGroup, Parser};
+
+#[derive(Parser)]
+#[clap(author, version, about, long_about = None)]
+#[clap(group(
+ ArgGroup::new("vers")
+ .required(true)
+ .args(&["set-ver", "major", "minor", "patch"]),
+ ))]
+struct Cli {
+ /// set version manually
+ #[clap(long, value_name = "VER", value_parser)]
+ set_ver: Option<String>,
+
+ /// auto inc major
+ #[clap(long, action)]
+ major: bool,
+
+ /// auto inc minor
+ #[clap(long, action)]
+ minor: bool,
+
+ /// auto inc patch
+ #[clap(long, action)]
+ patch: bool,
+
+ /// some regular input
+ #[clap(group = "input", value_parser)]
+ input_file: Option<String>,
+
+ /// some special input argument
+ #[clap(long, group = "input", value_parser)]
+ spec_in: Option<String>,
+
+ #[clap(short, requires = "input", value_parser)]
+ config: Option<String>,
+}
+
+fn main() {
+ let cli = Cli::parse();
+
+ // Let's assume the old version 1.2.3
+ let mut major = 1;
+ let mut minor = 2;
+ let mut patch = 3;
+
+ // See if --set_ver was used to set the version manually
+ let version = if let Some(ver) = cli.set_ver.as_deref() {
+ ver.to_string()
+ } else {
+ // Increment the one requested (in a real program, we'd reset the lower numbers)
+ let (maj, min, pat) = (cli.major, cli.minor, cli.patch);
+ match (maj, min, pat) {
+ (true, _, _) => major += 1,
+ (_, true, _) => minor += 1,
+ (_, _, true) => patch += 1,
+ _ => unreachable!(),
+ };
+ format!("{}.{}.{}", major, minor, patch)
+ };
+
+ println!("Version: {}", version);
+
+ // Check for usage of -c
+ if let Some(config) = cli.config.as_deref() {
+ let input = cli
+ .input_file
+ .as_deref()
+ .unwrap_or_else(|| cli.spec_in.as_deref().unwrap());
+ println!("Doing work using input {} and config {}", input, config);
+ }
+}
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.md b/vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.md
new file mode 100644
index 000000000..0f19bfe31
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.md
@@ -0,0 +1,57 @@
+```console
+$ 04_04_custom_derive --help
+clap [..]
+A simple to use, efficient, and full-featured Command Line Argument Parser
+
+USAGE:
+ 04_04_custom_derive[EXE] [OPTIONS] [INPUT_FILE]
+
+ARGS:
+ <INPUT_FILE> some regular input
+
+OPTIONS:
+ -c <CONFIG>
+ -h, --help Print help information
+ --major auto inc major
+ --minor auto inc minor
+ --patch auto inc patch
+ --set-ver <VER> set version manually
+ --spec-in <SPEC_IN> some special input argument
+ -V, --version Print version information
+
+$ 04_04_custom_derive
+? failed
+error: Can only modify one version field
+
+USAGE:
+ clap [OPTIONS] [INPUT_FILE]
+
+For more information try --help
+
+$ 04_04_custom_derive --major
+Version: 2.2.3
+
+$ 04_04_custom_derive --major --minor
+? failed
+error: Can only modify one version field
+
+USAGE:
+ clap [OPTIONS] [INPUT_FILE]
+
+For more information try --help
+
+$ 04_04_custom_derive --major -c config.toml
+? failed
+Version: 2.2.3
+error: INPUT_FILE or --spec-in is required when using --config
+
+USAGE:
+ clap [OPTIONS] [INPUT_FILE]
+
+For more information try --help
+
+$ 04_04_custom_derive --major -c config.toml --spec-in input.txt
+Version: 2.2.3
+Doing work using input input.txt and config config.toml
+
+```
diff --git a/vendor/clap/examples/tutorial_derive/04_04_custom.rs b/vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.rs
index 454d489c1..454d489c1 100644
--- a/vendor/clap/examples/tutorial_derive/04_04_custom.rs
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/04_04_custom.rs
diff --git a/vendor/clap-3.2.20/examples/tutorial_derive/05_01_assert.rs b/vendor/clap-3.2.20/examples/tutorial_derive/05_01_assert.rs
new file mode 100644
index 000000000..66dca727f
--- /dev/null
+++ b/vendor/clap-3.2.20/examples/tutorial_derive/05_01_assert.rs
@@ -0,0 +1,21 @@
+use clap::Parser;
+
+#[derive(Parser)]
+#[clap(author, version, about, long_about = None)]
+struct Cli {
+ /// Network port to use
+ #[clap(value_parser)]
+ port: u16,
+}
+
+fn main() {
+ let cli = Cli::parse();
+
+ println!("PORT = {}", cli.port);
+}
+
+#[test]
+fn verify_cli() {
+ use clap::CommandFactory;
+ Cli::command().debug_assert()
+}
diff --git a/vendor/clap/examples/typed-derive.md b/vendor/clap-3.2.20/examples/typed-derive.md
index 7c61f70d9..9c7615c63 100644
--- a/vendor/clap/examples/typed-derive.md
+++ b/vendor/clap-3.2.20/examples/typed-derive.md
@@ -1,6 +1,4 @@
-*Jump to [source](typed-derive.rs)*
-
-**This requires enabling the `derive` feature flag.**
+**This requires enabling the [`derive` feature flag][crate::_features].**
Help:
```console
diff --git a/vendor/clap/examples/typed-derive.rs b/vendor/clap-3.2.20/examples/typed-derive.rs
index 85c750f9c..31084029d 100644
--- a/vendor/clap/examples/typed-derive.rs
+++ b/vendor/clap-3.2.20/examples/typed-derive.rs
@@ -1,9 +1,7 @@
-// Note: this requires the `derive` feature
-
use clap::Parser;
use std::error::Error;
-#[derive(Parser, Debug)]
+#[derive(Parser, Debug)] // requires `derive` feature
struct Args {
/// Implicitly using `std::str::FromStr`
#[clap(short = 'O', value_parser)]
diff --git a/vendor/clap-3.2.20/src/_cookbook/cargo_example.rs b/vendor/clap-3.2.20/src/_cookbook/cargo_example.rs
new file mode 100644
index 000000000..ec5d582db
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/cargo_example.rs
@@ -0,0 +1,7 @@
+//! # Example: cargo subcommand (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/cargo-example.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/cargo-example.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/cargo_example_derive b/vendor/clap-3.2.20/src/_cookbook/cargo_example_derive
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/cargo_example_derive
diff --git a/vendor/clap-3.2.20/src/_cookbook/cargo_example_derive.rs b/vendor/clap-3.2.20/src/_cookbook/cargo_example_derive.rs
new file mode 100644
index 000000000..d49f956f9
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/cargo_example_derive.rs
@@ -0,0 +1,7 @@
+//! # Example: cargo subcommand (Derive API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/cargo-example-derive.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/cargo-example-derive.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/escaped_positional.rs b/vendor/clap-3.2.20/src/_cookbook/escaped_positional.rs
new file mode 100644
index 000000000..99a3f83f3
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/escaped_positional.rs
@@ -0,0 +1,7 @@
+//! # Example (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/escaped-positional.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/escaped-positional.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/escaped_positional_derive.rs b/vendor/clap-3.2.20/src/_cookbook/escaped_positional_derive.rs
new file mode 100644
index 000000000..e6f99ad17
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/escaped_positional_derive.rs
@@ -0,0 +1,7 @@
+//! # Example (Derive API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/escaped-positional-derive.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/escaped-positional-derive.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/git.rs b/vendor/clap-3.2.20/src/_cookbook/git.rs
new file mode 100644
index 000000000..03a926ca8
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/git.rs
@@ -0,0 +1,7 @@
+//! # Example: git-like CLI (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/git.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/git.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/git_derive.rs b/vendor/clap-3.2.20/src/_cookbook/git_derive.rs
new file mode 100644
index 000000000..d3119736d
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/git_derive.rs
@@ -0,0 +1,7 @@
+//! # Example: git-like CLI (Derive API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/git-derive.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/git-derive.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/mod.rs b/vendor/clap-3.2.20/src/_cookbook/mod.rs
new file mode 100644
index 000000000..1a78ed11b
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/mod.rs
@@ -0,0 +1,55 @@
+// Contributing
+//
+// New examples:
+// - Building: They must be added to `Cargo.toml` with the appropriate `required-features`.
+// - Testing: Ensure there is a markdown file with [trycmd](https://docs.rs/trycmd) syntax
+// - Link the `.md` file from here
+
+//! # Documentation: Cookbook
+//!
+//! Typed arguments: [derive][typed_derive]
+//! - Topics:
+//! - Custom `parse()`
+//!
+//! Custom cargo command: [builder][cargo_example], [derive][cargo_example_derive]
+//! - Topics:
+//! - Subcommands
+//! - Cargo plugins
+//!
+//! git-like interface: [builder][git], [derive][git_derive]
+//! - Topics:
+//! - Subcommands
+//! - External subcommands
+//! - Optional subcommands
+//! - Default subcommands
+//!
+//! pacman-like interface: [builder][pacman]
+//! - Topics:
+//! - Flag subcommands
+//! - Conflicting arguments
+//!
+//! Escaped positionals with `--`: [builder][escaped_positional], [derive][escaped_positional_derive]
+//!
+//! Multi-call
+//! - busybox: [builder][multicall_busybox]
+//! - Topics:
+//! - Subcommands
+//! - hostname: [builder][multicall_hostname]
+//! - Topics:
+//! - Subcommands
+//!
+//! repl: [builder][repl]
+//! - Topics:
+//! - Read-Eval-Print Loops / Custom command lines
+
+pub mod cargo_example;
+pub mod cargo_example_derive;
+pub mod escaped_positional;
+pub mod escaped_positional_derive;
+pub mod git;
+pub mod git_derive;
+pub mod multicall_busybox;
+pub mod multicall_hostname;
+pub mod pacman;
+pub mod repl;
+pub mod typed_derive;
diff --git a/vendor/clap-3.2.20/src/_cookbook/multicall_busybox.rs b/vendor/clap-3.2.20/src/_cookbook/multicall_busybox.rs
new file mode 100644
index 000000000..e3384d682
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/multicall_busybox.rs
@@ -0,0 +1,7 @@
+//! # Example: busybox-like CLI (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/multicall-busybox.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/multicall-busybox.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/multicall_hostname.rs b/vendor/clap-3.2.20/src/_cookbook/multicall_hostname.rs
new file mode 100644
index 000000000..9777654dc
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/multicall_hostname.rs
@@ -0,0 +1,7 @@
+//! # Example: hostname-like CLI (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/multicall-hostname.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/multicall-hostname.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/pacman.rs b/vendor/clap-3.2.20/src/_cookbook/pacman.rs
new file mode 100644
index 000000000..880c58158
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/pacman.rs
@@ -0,0 +1,7 @@
+//! # Example: pacman-like CLI (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/pacman.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/pacman.md")]
diff --git a/vendor/clap-3.2.20/src/_cookbook/repl.rs b/vendor/clap-3.2.20/src/_cookbook/repl.rs
new file mode 100644
index 000000000..549ec8259
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/repl.rs
@@ -0,0 +1,5 @@
+//! # Example: Command REPL (Builder API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/repl.rs")]
+//! ```
diff --git a/vendor/clap-3.2.20/src/_cookbook/typed_derive.rs b/vendor/clap-3.2.20/src/_cookbook/typed_derive.rs
new file mode 100644
index 000000000..a5fd15ff8
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_cookbook/typed_derive.rs
@@ -0,0 +1,7 @@
+//! # Example: Custom Types (Derive API)
+//!
+//! ```rust
+#![doc = include_str!("../../examples/typed-derive.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/typed-derive.md")]
diff --git a/vendor/clap-3.2.20/src/_derive/_tutorial.rs b/vendor/clap-3.2.20/src/_derive/_tutorial.rs
new file mode 100644
index 000000000..abd57cef8
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_derive/_tutorial.rs
@@ -0,0 +1,205 @@
+// Contributing
+//
+// New example code:
+// - Please update the corresponding section in the derive tutorial
+// - Building: They must be added to `Cargo.toml` with the appropriate `required-features`.
+// - Testing: Ensure there is a markdown file with [trycmd](https://docs.rs/trycmd) syntax
+//
+// See also the general CONTRIBUTING
+
+//! # Documentation: Derive Tutorial
+//!
+//! 1. [Quick Start](#quick-start)
+//! 2. [Configuring the Parser](#configuring-the-parser)
+//! 3. [Adding Arguments](#adding-arguments)
+//! 1. [Positionals](#positionals)
+//! 2. [Options](#options)
+//! 3. [Flags](#flags)
+//! 4. [Subcommands](#subcommands)
+//! 5. [Defaults](#defaults)
+//! 4. Validation
+//! 1. [Enumerated values](#enumerated-values)
+//! 2. [Validated values](#validated-values)
+//! 3. [Argument Relations](#argument-relations)
+//! 4. [Custom Validation](#custom-validation)
+//! 5. [Testing](#testing)
+//!
+//! See also
+//! - [FAQ: When should I use the builder vs derive APIs?][crate::_faq#when-should-i-use-the-builder-vs-derive-apis]
+//! - The [cookbook][crate::_cookbook] for more application-focused examples
+//!
+//! ## Quick Start
+//!
+//! You can create an application declaratively with a `struct` and some
+//! attributes. **This requires enabling the [`derive` feature flag][crate::_features].**
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/01_quick.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/tutorial_derive/01_quick.md")]
+//!
+//! ## Configuring the Parser
+//!
+//! You use derive [`Parser`][crate::Parser] to start building a parser.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/02_apps.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/tutorial_derive/02_apps.md")]
+//!
+//! You can use `#[clap(author, version, about)]` attribute defaults to fill these fields in from your `Cargo.toml` file.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/02_crate.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/02_crate.md")]
+//!
+//! You can use attributes to change the application level behavior of clap. Any [`Command`][crate::Command]] builder function can be used as an attribute.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/02_app_settings.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/02_app_settings.md")]
+//!
+//! ## Adding Arguments
+//!
+//! ### Positionals
+//!
+//! You can have users specify values by their position on the command-line:
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_03_positional.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/03_03_positional.md")]
+//!
+//! ### Options
+//!
+//! You can name your arguments with a flag:
+//! - Order doesn't matter
+//! - They can be optional
+//! - Intent is clearer
+//!
+//! The `#[clap(short = 'n')]` and `#[clap(long = "name")]` attributes that define
+//! the flags are [`Arg`][crate::Args] methods that are derived from the field name when no value
+//! is specified (`#[clap(short)]` and `#[clap(long)]`).
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_02_option.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/03_02_option.md")]
+//!
+//! ### Flags
+//!
+//! Flags can also be switches that can be on/off. This is enabled via the
+//! `#[clap(action = ArgAction::SetTrue)]` attribute though this is implied when the field is a
+//! `bool`.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_01_flag_bool.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/03_01_flag_bool.md")]
+//!
+//! Or counted with `#[clap(action = clap::ArgAction::Count)]`:
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_01_flag_count.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/03_01_flag_count.md")]
+//!
+//! ### Subcommands
+//!
+//! Subcommands are derived with `#[derive(Subcommand)]` and be added via `#[clap(subcommand)]` attribute. Each
+//! instance of a [Subcommand][crate::Subcommand] can have its own version, author(s), Args, and even its own
+//! subcommands.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_04_subcommands.rs")]
+//! ```
+//! We used a struct-variant to define the `add` subcommand.
+//! Alternatively, you can use a struct for your subcommand's arguments:
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_04_subcommands_alt.rs")]
+//! ```
+//!
+#![doc = include_str!("../../examples/tutorial_derive/03_04_subcommands.md")]
+//!
+//! ### Defaults
+//!
+//! We've previously showed that arguments can be [`required`][crate::Arg::required] or optional.
+//! When optional, you work with a `Option` and can `unwrap_or`. Alternatively, you can
+//! set `#[clap(default_value_t)]`.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/03_05_default_values.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/03_05_default_values.md")]
+//!
+//! ## Validation
+//!
+//! ### Enumerated values
+//!
+//! If you have arguments of specific values you want to test for, you can derive
+//! [`ValueEnum`][crate::ValueEnum].
+//!
+//! This allows you specify the valid values for that argument. If the user does not use one of
+//! those specific values, they will receive a graceful exit with error message informing them
+//! of the mistake, and what the possible valid values are
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/04_01_enum.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/04_01_enum.md")]
+//!
+//! ### Validated values
+//!
+//! More generally, you can validate and parse into any data type.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/04_02_parse.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/04_02_parse.md")]
+//!
+//! A custom parser can be used to improve the error messages or provide additional validation:
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/04_02_validate.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/04_02_validate.md")]
+//!
+//! ### Argument Relations
+//!
+//! You can declare dependencies or conflicts between [`Arg`][crate::Arg]s or even
+//! [`ArgGroup`][crate::ArgGroup]s.
+//!
+//! [`ArgGroup`][crate::ArgGroup]s make it easier to declare relations instead of having to list
+//! each individually, or when you want a rule to apply "any but not all" arguments.
+//!
+//! Perhaps the most common use of [`ArgGroup`][crate::ArgGroup]s is to require one and *only* one
+//! argument to be present out of a given set. Imagine that you had multiple arguments, and you
+//! want one of them to be required, but making all of them required isn't feasible because perhaps
+//! they conflict with each other.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/04_03_relations.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/04_03_relations.md")]
+//!
+//! ### Custom Validation
+//!
+//! As a last resort, you can create custom errors with the basics of clap's formatting.
+//!
+//! ```rust
+#![doc = include_str!("../../examples/tutorial_derive/04_04_custom.rs")]
+//! ```
+#![doc = include_str!("../../examples/tutorial_derive/04_04_custom.md")]
+//!
+//! ## Testing
+//!
+//! clap reports most development errors as `debug_assert!`s. Rather than checking every
+//! subcommand, you should have a test that calls
+//! [`Command::debug_assert`][crate::App::debug_assert]:
+//! ```rust,no_run
+#![doc = include_str!("../../examples/tutorial_derive/05_01_assert.rs")]
+//! ```
diff --git a/vendor/clap-3.2.20/src/_derive/mod.rs b/vendor/clap-3.2.20/src/_derive/mod.rs
new file mode 100644
index 000000000..fc9f35db5
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_derive/mod.rs
@@ -0,0 +1,510 @@
+//! # Documentation: Derive Reference
+//!
+//! 1. [Overview](#overview)
+//! 2. [Attributes](#attributes)
+//! 1. [Terminology](#terminology)
+//! 2. [Command Attributes](#command-attributes)
+//! 3. [Arg Attributes](#arg-attributes)
+//! 4. [ValueEnum Attributes](#valueenum-attributes)
+//! 5. [Possible Value Attributes](#possible-value-attributes)
+//! 3. [Arg Types](#arg-types)
+//! 4. [Doc Comments](#doc-comments)
+//! 5. [Mixing Builder and Derive APIs](#mixing-builder-and-derive-apis)
+//! 6. [Tips](#tips)
+//!
+//! ## Overview
+//!
+//! To derive `clap` types, you need to enable the [`derive` feature flag][crate::_features].
+//!
+//! Example:
+//! ```rust
+#![doc = include_str!("../../examples/demo.rs")]
+//! ```
+//!
+//! Let's start by breaking down the anatomy of the derive attributes:
+//! ```rust
+//! use clap::{Parser, Args, Subcommand, ValueEnum};
+//!
+//! /// Doc comment
+//! #[derive(Parser)]
+//! #[clap(APP ATTRIBUTE)]
+//! struct Cli {
+//! /// Doc comment
+//! #[clap(ARG ATTRIBUTE)]
+//! field: UserType,
+//!
+//! #[clap(value_enum, ARG ATTRIBUTE...)]
+//! field: EnumValues,
+//!
+//! #[clap(flatten)]
+//! delegate: Struct,
+//!
+//! #[clap(subcommand)]
+//! command: Command,
+//! }
+//!
+//! /// Doc comment
+//! #[derive(Args)]
+//! #[clap(PARENT APP ATTRIBUTE)]
+//! struct Struct {
+//! /// Doc comment
+//! #[clap(ARG ATTRIBUTE)]
+//! field: UserType,
+//! }
+//!
+//! /// Doc comment
+//! #[derive(Subcommand)]
+//! #[clap(PARENT APP ATTRIBUTE)]
+//! enum Command {
+//! /// Doc comment
+//! #[clap(APP ATTRIBUTE)]
+//! Variant1(Struct),
+//!
+//! /// Doc comment
+//! #[clap(APP ATTRIBUTE)]
+//! Variant2 {
+//! /// Doc comment
+//! #[clap(ARG ATTRIBUTE)]
+//! field: UserType,
+//! }
+//! }
+//!
+//! /// Doc comment
+//! #[derive(ValueEnum)]
+//! #[clap(VALUE ENUM ATTRIBUTE)]
+//! enum EnumValues {
+//! /// Doc comment
+//! #[clap(POSSIBLE VALUE ATTRIBUTE)]
+//! Variant1,
+//! }
+//!
+//! fn main() {
+//! let cli = Cli::parse();
+//! }
+//! ```
+//!
+//! Traits:
+//! - [`Parser`][crate::Parser] parses arguments into a `struct` (arguments) or `enum` (subcommands).
+//! - [`Args`][crate::Args] allows defining a set of re-usable arguments that get merged into their parent container.
+//! - [`Subcommand`][crate::Subcommand] defines available subcommands.
+//! - Subcommand arguments can be defined in a struct-variant or automatically flattened with a tuple-variant.
+//! - [`ValueEnum`][crate::ValueEnum] allows parsing a value directly into an `enum`, erroring on unsupported values.
+//! - The derive doesn't work on enums that contain non-unit variants, unless they are skipped
+//!
+//! *See also the [derive tutorial][crate::_derive::_tutorial] and [cookbook][crate::_cookbook]*
+//!
+//! ## Attributes
+//!
+//! ### Terminology
+//!
+//! **Raw attributes** are forwarded directly to the underlying [`clap` builder][crate::builder]. Any
+//! [`Command`][crate::Command], [`Arg`][crate::Arg], or [`PossibleValue`][crate::PossibleValue] method can be used as an attribute.
+//!
+//! Raw attributes come in two different syntaxes:
+//! ```rust,ignore
+//! #[clap(
+//! global = true, // name = arg form, neat for one-arg methods
+//! required_if_eq("out", "file") // name(arg1, arg2, ...) form.
+//! )]
+//! ```
+//!
+//! - `method = arg` can only be used for methods which take only one argument.
+//! - `method(arg1, arg2)` can be used with any method.
+//!
+//! As long as `method_name` is not one of the magical methods it will be
+//! translated into a mere method call.
+//!
+//! **Magic attributes** have post-processing done to them, whether that is
+//! - Providing of defaults
+//! - Special behavior is triggered off of it
+//!
+//! Magic attributes are more constrained in the syntax they support, usually just
+//! `<attr> = <value>` though some use `<attr>(<value>)` instead. See the specific
+//! magic attributes documentation for details. This allows users to access the
+//! raw behavior of an attribute via `<attr>(<value>)` syntax.
+//!
+//! **NOTE:** Some attributes are inferred from [Arg Types](#arg-types) and [Doc
+//! Comments](#doc-comments). Explicit attributes take precedence over inferred
+//! attributes.
+//!
+//! ### Command Attributes
+//!
+//! These correspond to a [`Command`][crate::Command] which is used for both top-level parsers and
+//! when defining subcommands.
+//!
+//! **Raw attributes:** Any [`Command` method][crate::Command] can also be used as an attribute,
+//! see [Terminology](#terminology) for syntax.
+//! - e.g. `#[clap(arg_required_else_help(true))]` would translate to `cmd.arg_required_else_help(true)`
+//!
+//! **Magic attributes:**
+//! - `name = <expr>`: [`Command::name`][crate::App::name]
+//! - When not present: [crate `name`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field) (if on [`Parser`][crate::Parser] container), variant name (if on [`Subcommand`][crate::Subcommand] variant)
+//! - `version [= <expr>]`: [`Command::version`][crate::App::version]
+//! - When not present: no version set
+//! - Without `<expr>`: defaults to [crate `version`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field)
+//! - `author [= <expr>]`: [`Command::author`][crate::App::author]
+//! - When not present: no author set
+//! - Without `<expr>`: defaults to [crate `authors`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-authors-field)
+//! - `about [= <expr>]`: [`Command::about`][crate::App::about]
+//! - When not present: [Doc comment summary](#doc-comments)
+//! - Without `<expr>`: [crate `description`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-description-field) ([`Parser`][crate::Parser] container)
+//! - **TIP:** When a doc comment is also present, you most likely want to add
+//! `#[clap(long_about = None)]` to clear the doc comment so only [`about`][crate::App::about]
+//! gets shown with both `-h` and `--help`.
+//! - `long_about = <expr>`: [`Command::long_about`][crate::App::long_about]
+//! - When not present: [Doc comment](#doc-comments) if there is a blank line, else nothing
+//! - `verbatim_doc_comment`: Minimizes pre-processing when converting doc comments to [`about`][crate::App::about] / [`long_about`][crate::App::long_about]
+//! - `next_display_order`: [`Command::next_display_order`][crate::App::next_display_order]
+//! - `next_help_heading`: [`Command::next_help_heading`][crate::App::next_help_heading]
+//! - When `flatten`ing [`Args`][crate::Args], this is scoped to just the args in this struct and any struct `flatten`ed into it
+//! - `rename_all = <string_literal>`: Override default field / variant name case conversion for [`Command::name`][crate::Command::name] / [`Arg::id`][crate::Arg::id]
+//! - When not present: `"kebab-case"`
+//! - Available values: `"camelCase"`, `"kebab-case"`, `"PascalCase"`, `"SCREAMING_SNAKE_CASE"`, `"snake_case"`, `"lower"`, `"UPPER"`, `"verbatim"`
+//! - `rename_all_env = <string_literal>`: Override default field name case conversion for env variables for [`Arg::env`][crate::Arg::env]
+//! - When not present: `"SCREAMING_SNAKE_CASE"`
+//! - Available values: `"camelCase"`, `"kebab-case"`, `"PascalCase"`, `"SCREAMING_SNAKE_CASE"`, `"snake_case"`, `"lower"`, `"UPPER"`, `"verbatim"`
+//!
+//! And for [`Subcommand`][crate::Subcommand] variants:
+//! - `skip`: Ignore this variant
+//! - `flatten`: Delegates to the variant for more subcommands (must implement
+//! [`Subcommand`][crate::Subcommand])
+//! - `subcommand`: Nest subcommands under the current set of subcommands (must implement
+//! [`Subcommand`][crate::Subcommand])
+//! - `external_subcommand`: [`Command::allow_external_subcommand(true)`][crate::App::allow_external_subcommands]
+//! - Variant must be either `Variant(Vec<String>)` or `Variant(Vec<OsString>)`
+//!
+//! ### Arg Attributes
+//!
+//! These correspond to a [`Arg`][crate::Arg].
+//!
+//! **Raw attributes:** Any [`Arg` method][crate::Arg] can also be used as an attribute, see [Terminology](#terminology) for syntax.
+//! - e.g. `#[clap(max_values(3))]` would translate to `arg.max_values(3)`
+//!
+//! **Magic attributes**:
+//! - `id = <expr>`: [`Arg::id`][crate::Arg::id]
+//! - When not present: case-converted field name is used
+//! - `name = <expr>`: [`Arg::id`][crate::Arg::id]
+//! - **Deprecated:** use `id`
+//! - `value_parser [= <expr>]`: [`Arg::value_parser`][crate::Arg::value_parser]
+//! - When not present: will auto-select an implementation based on the field type using
+//! [`value_parser!][crate::value_parser!]
+//! - When present but defaulted: opt-in to clap v4 semantics
+//! - Env parsing is now dependent on inferred parser
+//! - `PathBuf` will implicitly skip UTF-8 validation (before it required specifying
+//! `try_from_os_str`)
+//! - When present, implies `#[clap(action)]`
+//! - To register a custom type's [`ValueParser`][crate::builder::ValueParser], implement [`ValueParserFactory`][crate::builder::ValueParserFactory]
+//! - `action [= <expr>]`: [`Arg::action`][crate::Arg::action]
+//! - When not present: will auto-select an action based on the field type
+//! - When present but defaulted: opt-in to clap v4 semantics
+//! - When present, implies `#[clap(value_parser)]`
+//! - `args_override_self` is forced on for single flags
+//! - `help = <expr>`: [`Arg::help`][crate::Arg::help]
+//! - When not present: [Doc comment summary](#doc-comments)
+//! - `long_help = <expr>`: [`Arg::long_help`][crate::Arg::long_help]
+//! - When not present: [Doc comment](#doc-comments) if there is a blank line, else nothing
+//! - `verbatim_doc_comment`: Minimizes pre-processing when converting doc comments to [`help`][crate::Arg::help] / [`long_help`][crate::Arg::long_help]
+//! - `short [= <char>]`: [`Arg::short`][crate::Arg::short]
+//! - When not present: no short set
+//! - Without `<char>`: defaults to first character in the case-converted field name
+//! - `long [= <str>]`: [`Arg::long`][crate::Arg::long]
+//! - When not present: no long set
+//! - Without `<str>`: defaults to the case-converted field name
+//! - `env [= <str>]`: [`Arg::env`][crate::Arg::env] (needs [`env` feature][crate::_features] enabled)
+//! - When not present: no env set
+//! - Without `<str>`: defaults to the case-converted field name
+//! - `flatten`: Delegates to the field for more arguments (must implement [`Args`][crate::Args])
+//! - Only [`next_help_heading`][crate::Command::next_help_heading] can be used with `flatten`. See
+//! [clap-rs/clap#3269](https://github.com/clap-rs/clap/issues/3269) for why
+//! arg attributes are not generally supported.
+//! - **Tip:** Though we do apply a flattened [`Args`][crate::Args]'s Parent Command Attributes, this
+//! makes reuse harder. Generally prefer putting the cmd attributes on the
+//! [`Parser`][crate::Parser] or on the flattened field.
+//! - `subcommand`: Delegates definition of subcommands to the field (must implement
+//! [`Subcommand`][crate::Subcommand])
+//! - When `Option<T>`, the subcommand becomes optional
+//! - `from_global`: Read a [`Arg::global`][crate::Arg::global] argument (raw attribute), regardless of what subcommand you are in
+//! - `parse(<kind> [= <function>])`: [`Arg::validator`][crate::Arg::validator] and [`ArgMatches::values_of_t`][crate::ArgMatches::values_of_t]
+//! - **Deprecated:**
+//! - Use `value_parser(...)` for `from_str`, `try_from_str`, `from_os_str`, and `try_from_os_str`
+//! - Use `action(ArgAction::Count` for `from_occurrences`
+//! - Use `action(ArgAction::SetTrue` for `from_flag`
+//! - Default: `try_from_str`
+//! - Warning: for `Path` / `OsString`, be sure to use `try_from_os_str`
+//! - See [Arg Types](#arg-types) for more details
+//! - `value_enum`: Parse the value using the [`ValueEnum`][crate::ValueEnum]
+//! - `skip [= <expr>]`: Ignore this field, filling in with `<expr>`
+//! - Without `<expr>`: fills the field with `Default::default()`
+//! - `default_value = <str>`: [`Arg::default_value`][crate::Arg::default_value] and [`Arg::required(false)`][crate::Arg::required]
+//! - `default_value_t [= <expr>]`: [`Arg::default_value`][crate::Arg::default_value] and [`Arg::required(false)`][crate::Arg::required]
+//! - Requires `std::fmt::Display` or `#[clap(value_enum)]`
+//! - Without `<expr>`, relies on `Default::default()`
+//! - `default_values_t = <expr>`: [`Arg::default_values`][crate::Arg::default_values] and [`Arg::required(false)`][crate::Arg::required]
+//! - Requires field arg to be of type `Vec<T>` and `T` to implement `std::fmt::Display` or `#[clap(value_enum)]`
+//! - `<expr>` must implement `IntoIterator<T>`
+//! - `default_value_os_t [= <expr>]`: [`Arg::default_value_os`][crate::Arg::default_value_os] and [`Arg::required(false)`][crate::Arg::required]
+//! - Requires `std::convert::Into<OsString>` or `#[clap(value_enum)]`
+//! - Without `<expr>`, relies on `Default::default()`
+//! - `default_values_os_t = <expr>`: [`Arg::default_values_os`][crate::Arg::default_values_os] and [`Arg::required(false)`][crate::Arg::required]
+//! - Requires field arg to be of type `Vec<T>` and `T` to implement `std::convert::Into<OsString>` or `#[clap(value_enum)]`
+//! - `<expr>` must implement `IntoIterator<T>`
+//!
+//! ### ValueEnum Attributes
+//!
+//! - `rename_all = <string_literal>`: Override default field / variant name case conversion for [`PossibleValue::new`][crate::PossibleValue]
+//! - When not present: `"kebab-case"`
+//! - Available values: `"camelCase"`, `"kebab-case"`, `"PascalCase"`, `"SCREAMING_SNAKE_CASE"`, `"snake_case"`, `"lower"`, `"UPPER"`, `"verbatim"`
+//!
+//! ### Possible Value Attributes
+//!
+//! These correspond to a [`PossibleValue`][crate::PossibleValue].
+//!
+//! **Raw attributes:** Any [`PossibleValue` method][crate::PossibleValue] can also be used as an attribute, see [Terminology](#terminology) for syntax.
+//! - e.g. `#[clap(alias("foo"))]` would translate to `pv.alias("foo")`
+//!
+//! **Magic attributes**:
+//! - `name = <expr>`: [`PossibleValue::new`][crate::PossibleValue::new]
+//! - When not present: case-converted field name is used
+//! - `help = <expr>`: [`PossibleValue::help`][crate::PossibleValue::help]
+//! - When not present: [Doc comment summary](#doc-comments)
+//!
+//! ## Arg Types
+//!
+//! `clap` assumes some intent based on the type used:
+//!
+//! | Type | Effect | Implies |
+//! |---------------------|--------------------------------------|------------------------------------------------------------------|
+//! | `bool` | flag | `#[clap(parse(from_flag))]` |
+//! | `Option<T>` | optional argument | `.takes_value(true).required(false)` |
+//! | `Option<Option<T>>` | optional value for optional argument | `.takes_value(true).required(false).min_values(0).max_values(1)` |
+//! | `T` | required argument | `.takes_value(true).required(!has_default)` |
+//! | `Vec<T>` | `0..` occurrences of argument | `.takes_value(true).required(false).multiple_occurrences(true)` |
+//! | `Option<Vec<T>>` | `0..` occurrences of argument | `.takes_value(true).required(false).multiple_occurrences(true)` |
+//!
+//! Notes:
+//! - For custom type behavior, you can override the implied attributes/settings and/or set additional ones
+//! - For example, see [custom-bool](./custom-bool.md)
+//! - `Option<Vec<T>>` will be `None` instead of `vec![]` if no arguments are provided.
+//! - This gives the user some flexibility in designing their argument, like with `min_values(0)`
+//!
+//! You can then support your custom type with `#[clap(parse(<kind> [= <function>]))]`:
+//!
+//! | `<kind>` | Signature | Default `<function>` |
+//! |--------------------------|---------------------------------------|---------------------------------|
+//! | `from_str` | `fn(&str) -> T` | `::std::convert::From::from` |
+//! | `try_from_str` (default) | `fn(&str) -> Result<T, E>` | `::std::str::FromStr::from_str` |
+//! | `from_os_str` | `fn(&OsStr) -> T` | `::std::convert::From::from` |
+//! | `try_from_os_str` | `fn(&OsStr) -> Result<T, E>` | (no default function) |
+//! | `from_occurrences` | `fn(u64) -> T` | `value as T` |
+//! | `from_flag` | `fn(bool) -> T` | `::std::convert::From::from` |
+//!
+//! Notes:
+//! - `from_os_str`:
+//! - Implies `arg.takes_value(true).allow_invalid_utf8(true)`
+//! - `try_from_os_str`:
+//! - Implies `arg.takes_value(true).allow_invalid_utf8(true)`
+//! - `from_occurrences`:
+//! - Implies `arg.takes_value(false).multiple_occurrences(true)`
+//! - Reads from `clap::ArgMatches::occurrences_of` rather than a `get_one` function
+//! - Note: operations on values, like `default_value`, are unlikely to do what you want
+//! - `from_flag`
+//! - Implies `arg.takes_value(false)`
+//! - Reads from `clap::ArgMatches::is_present` rather than a `get_one` function
+//! - Note: operations on values, like `default_value`, are unlikely to do what you want
+//!
+//! **Warning:**
+//! - To support non-UTF8 paths, you should use `#[clap(value_parser)]` otherwise
+//! `clap` will parse it as a `String` which will fail on some paths.
+//!
+//! ## Doc Comments
+//!
+//! In clap, help messages for the whole binary can be specified
+//! via [`Command::about`][crate::App::about] and [`Command::long_about`][crate::App::long_about] while help messages
+//! for individual arguments can be specified via [`Arg::help`][crate::Arg::help] and [`Arg::long_help`][crate::Arg::long_help].
+//!
+//! `long_*` variants are used when user calls the program with
+//! `--help` and "short" variants are used with `-h` flag.
+//!
+//! ```rust
+//! # use clap::Parser;
+//!
+//! #[derive(Parser)]
+//! #[clap(about = "I am a program and I work, just pass `-h`", long_about = None)]
+//! struct Foo {
+//! #[clap(short, help = "Pass `-h` and you'll see me!")]
+//! bar: String,
+//! }
+//! ```
+//!
+//! For convenience, doc comments can be used instead of raw methods
+//! (this example works exactly like the one above):
+//!
+//! ```rust
+//! # use clap::Parser;
+//!
+//! #[derive(Parser)]
+//! /// I am a program and I work, just pass `-h`
+//! struct Foo {
+//! /// Pass `-h` and you'll see me!
+//! bar: String,
+//! }
+//! ```
+//!
+//! **NOTE:** Attributes have priority over doc comments!
+//!
+//! **Top level doc comments always generate `Command::about/long_about` calls!**
+//! If you really want to use the `Command::about/long_about` methods (you likely don't),
+//! use the `about` / `long_about` attributes to override the calls generated from
+//! the doc comment. To clear `long_about`, you can use
+//! `#[clap(long_about = None)]`.
+//!
+//! **TIP:** Set `#![deny(missing_docs)]` to catch missing `--help` documentation at compile time.
+//!
+//! ### Pre-processing
+//!
+//! ```rust
+//! # use clap::Parser;
+//! #[derive(Parser)]
+//! /// Hi there, I'm Robo!
+//! ///
+//! /// I like beeping, stumbling, eating your electricity,
+//! /// and making records of you singing in a shower.
+//! /// Pay up, or I'll upload it to youtube!
+//! struct Robo {
+//! /// Call my brother SkyNet.
+//! ///
+//! /// I am artificial superintelligence. I won't rest
+//! /// until I'll have destroyed humanity. Enjoy your
+//! /// pathetic existence, you mere mortals.
+//! #[clap(long, action)]
+//! kill_all_humans: bool,
+//! }
+//! ```
+//!
+//! A doc comment consists of three parts:
+//! - Short summary
+//! - A blank line (whitespace only)
+//! - Detailed description, all the rest
+//!
+//! The summary corresponds with `Command::about` / `Arg::help`. When a blank line is
+//! present, the whole doc comment will be passed to `Command::long_about` /
+//! `Arg::long_help`. Or in other words, a doc may result in just a `Command::about` /
+//! `Arg::help` or `Command::about` / `Arg::help` and `Command::long_about` /
+//! `Arg::long_help`
+//!
+//! In addition, when `verbatim_doc_comment` is not present, `clap` applies some preprocessing, including:
+//!
+//! - Strip leading and trailing whitespace from every line, if present.
+//!
+//! - Strip leading and trailing blank lines, if present.
+//!
+//! - Interpret each group of non-empty lines as a word-wrapped paragraph.
+//!
+//! We replace newlines within paragraphs with spaces to allow the output
+//! to be re-wrapped to the terminal width.
+//!
+//! - Strip any excess blank lines so that there is exactly one per paragraph break.
+//!
+//! - If the first paragraph ends in exactly one period,
+//! remove the trailing period (i.e. strip trailing periods but not trailing ellipses).
+//!
+//! Sometimes you don't want this preprocessing to apply, for example the comment contains
+//! some ASCII art or markdown tables, you would need to preserve LFs along with
+//! blank lines and the leading/trailing whitespace. When you pass use the
+//! `verbatim_doc_comment` magic attribute, you preserve
+//! them.
+//!
+//! **Note:** Keep in mind that `verbatim_doc_comment` will *still*
+//! - Remove one leading space from each line, even if this attribute is present,
+//! to allow for a space between `///` and the content.
+//! - Remove leading and trailing blank lines
+//!
+//! ## Mixing Builder and Derive APIs
+//!
+//! The builder and derive APIs do not live in isolation. They can work together, which is
+//! especially helpful if some arguments can be specified at compile-time while others must be
+//! specified at runtime.
+//!
+//! ### Using derived arguments in a builder application
+//!
+//! When using the derive API, you can `#[clap(flatten)]` a struct deriving `Args` into a struct
+//! deriving `Args` or `Parser`. This example shows how you can augment a `Command` instance
+//! created using the builder API with `Args` created using the derive API.
+//!
+//! It uses the [`Args::augment_args`][crate::Args::augment_args] method to add the arguments to
+//! the `Command` instance.
+//!
+//! Crates such as [clap-verbosity-flag](https://github.com/rust-cli/clap-verbosity-flag) provide
+//! structs that implement `Args`. Without the technique shown in this example, it would not be
+//! possible to use such crates with the builder API.
+//!
+//! For example:
+//! ```rust
+#![doc = include_str!("../../examples/derive_ref/augment_args.rs")]
+//! ```
+//!
+//! ### Using derived subcommands in a builder application
+//!
+//! When using the derive API, you can use `#[clap(subcommand)]` inside the struct to add
+//! subcommands. The type of the field is usually an enum that derived `Parser`. However, you can
+//! also add the subcommands in that enum to a `Command` instance created with the builder API.
+//!
+//! It uses the [`Subcommand::augment_subcommands`][crate::Subcommand::augment_subcommands] method
+//! to add the subcommands to the `Command` instance.
+//!
+//! For example:
+//! ```rust
+#![doc = include_str!("../../examples/derive_ref/augment_subcommands.rs")]
+//! ```
+//!
+//! ### Adding hand-implemented subcommands to a derived application
+//!
+//! When using the derive API, you can use `#[clap(subcommand)]` inside the struct to add
+//! subcommands. The type of the field is usually an enum that derived `Parser`. However, you can
+//! also implement the `Subcommand` trait manually on this enum (or any other type) and it can
+//! still be used inside the struct created with the derive API. The implementation of the
+//! `Subcommand` trait will use the builder API to add the subcommands to the `Command` instance
+//! created behind the scenes for you by the derive API.
+//!
+//! Notice how in the previous example we used
+//! [`augment_subcommands`][crate::Subcommand::augment_subcommands] on an enum that derived
+//! `Parser`, whereas now we implement
+//! [`augment_subcommands`][crate::Subcommand::augment_subcommands] ourselves, but the derive API
+//! calls it automatically since we used the `#[clap(subcommand)]` attribute.
+//!
+//! For example:
+//! ```rust
+#![doc = include_str!("../../examples/derive_ref/hand_subcommand.rs")]
+//! ```
+//!
+//! ### Flattening hand-implemented args into a derived application
+//!
+//! When using the derive API, you can use `#[clap(flatten)]` inside the struct to add arguments as
+//! if they were added directly to the containing struct. The type of the field is usually an
+//! struct that derived `Args`. However, you can also implement the `Args` trait manually on this
+//! struct (or any other type) and it can still be used inside the struct created with the derive
+//! API. The implementation of the `Args` trait will use the builder API to add the arguments to
+//! the `Command` instance created behind the scenes for you by the derive API.
+//!
+//! Notice how in the previous example we used [`augment_args`][crate::Args::augment_args] on the
+//! struct that derived `Parser`, whereas now we implement
+//! [`augment_args`][crate::Args::augment_args] ourselves, but the derive API calls it
+//! automatically since we used the `#[clap(flatten)]` attribute.
+//!
+//! For example:
+//! ```rust
+#![doc = include_str!("../../examples/derive_ref/flatten_hand_args.rs")]
+//! ```
+//!
+//! ## Tips
+//!
+//! - To get access to a [`Command`][crate::Command] call
+//! [`CommandFactory::command`][crate::CommandFactory::command] (implemented when deriving
+//! [`Parser`][crate::Parser])
+//! - Proactively check for bad [`Command`][crate::Command] configurations by calling
+//! [`Command::debug_assert`][crate::App::debug_assert] in a test
+//! ([example](../tutorial_derive/05_01_assert.rs))
+
+pub mod _tutorial;
+#[doc(inline)]
+pub use crate::_cookbook;
diff --git a/vendor/clap-3.2.20/src/_faq.rs b/vendor/clap-3.2.20/src/_faq.rs
new file mode 100644
index 000000000..661a7e73d
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_faq.rs
@@ -0,0 +1,95 @@
+//! # Documentation: FAQ
+//!
+//! 1. [Comparisons](#comparisons)
+//! 1. [How does `clap` compare to structopt?](#how-does-clap-compare-to-structopt)
+//! 2. [What are some reasons to use `clap`? (The Pitch)](#what-are-some-reasons-to-use-clap-the-pitch)
+//! 3. [What are some reasons *not* to use `clap`? (The Anti Pitch)](#what-are-some-reasons-not-to-use-clap-the-anti-pitch)
+//! 4. [Reasons to use `clap`](#reasons-to-use-clap)
+//! 2. [How many approaches are there to create a parser?](#how-many-approaches-are-there-to-create-a-parser)
+//! 3. [When should I use the builder vs derive APIs?](#when-should-i-use-the-builder-vs-derive-apis)
+//! 4. [Why is there a default subcommand of help?](#why-is-there-a-default-subcommand-of-help)
+//!
+//! ### Comparisons
+//!
+//! First, let me say that these comparisons are highly subjective, and not meant
+//! in a critical or harsh manner. All the argument parsing libraries out there (to
+//! include `clap`) have their own strengths and weaknesses. Sometimes it just
+//! comes down to personal taste when all other factors are equal. When in doubt,
+//! try them all and pick one that you enjoy :) There's plenty of room in the Rust
+//! community for multiple implementations!
+//!
+//! For less detailed but more broad comparisons, see
+//! [argparse-benchmarks](https://github.com/rust-cli/argparse-benchmarks-rs).
+//!
+//! #### How does `clap` compare to [structopt](https://github.com/TeXitoi/structopt)?
+//!
+//! Simple! `clap` *is* `structopt`. `structopt` started as a derive API built on
+//! top of clap v2. With clap v3, we've forked structopt and integrated it
+//! directly into clap. structopt is in
+//! [maintenance mode](https://github.com/TeXitoi/structopt/issues/516#issuecomment-989566094)
+//! with the release of `clap_derive`.
+//!
+//! The benefits of integrating `structopt` and `clap` are:
+//! - Easier cross-linking in documentation
+//! - [Documentation parity](../examples)
+//! - Tighter design feedback loop, ensuring all new features are designed with
+//! derives in mind and easier to change `clap` in response to `structopt` bugs.
+//! - Clearer endorsement of `structopt`
+//!
+//! See also
+//! - [`clap` v3 CHANGELOG](../CHANGELOG.md#300---2021-12-31)
+//! - [`structopt` migration guide](../CHANGELOG.md#migrate-structopt)
+//!
+//! #### What are some reasons to use `clap`? (The Pitch)
+//!
+//! `clap` is as fast, and as lightweight as possible while still giving all the features you'd expect from a modern argument parser. In fact, for the amount and type of features `clap` offers it remains about as fast as `getopts`. If you use `clap` when just need some simple arguments parsed, you'll find it's a walk in the park. `clap` also makes it possible to represent extremely complex, and advanced requirements, without too much thought. `clap` aims to be intuitive, easy to use, and fully capable for wide variety use cases and needs.
+//!
+//! #### What are some reasons *not* to use `clap`? (The Anti Pitch)
+//!
+//! Depending on the style in which you choose to define the valid arguments, `clap` can be very verbose. `clap` also offers so many finetuning knobs and dials, that learning everything can seem overwhelming. I strive to keep the simple cases simple, but when turning all those custom dials it can get complex. `clap` is also opinionated about parsing. Even though so much can be tweaked and tuned with `clap` (and I'm adding more all the time), there are still certain features which `clap` implements in specific ways which may be contrary to some users use-cases.
+//!
+//! #### Reasons to use `clap`
+//!
+//! * You want all the nice CLI features your users may expect, yet you don't want to implement them all yourself. You'd like to focus your application, not argument parsing.
+//! * In addition to the point above; you don't want to sacrifice performance to get all those nice features
+//! * You have complex requirements/conflicts between your various valid args.
+//! * You want to use subcommands (although other libraries also support subcommands, they are not nearly as feature rich as those provided by `clap`)
+//! * You want some sort of custom validation built into the argument parsing process, instead of as part of your application (which allows for earlier failures, better error messages, more cohesive experience, etc.)
+//!
+//! ### How many approaches are there to create a parser?
+//!
+//! The following APIs are supported:
+//! - [Derive][crate::_derive::_tutorial]
+//! - [Builder][crate::_tutorial]
+//!
+//! Previously, we supported:
+//! - [YAML](https://github.com/clap-rs/clap/issues/3087)
+//! - [docopt](http://docopt.org/)-inspired [usage parser](https://github.com/clap-rs/clap/issues/3086)
+//! - [`clap_app!`](https://github.com/clap-rs/clap/issues/2835)
+//!
+//! There are also experiments with other APIs:
+//! - [fncmd](https://github.com/yuhr/fncmd): function attribute
+//! - [clap-serde](https://github.com/aobatact/clap-serde): create an `Command` from a deserializer
+//!
+//! ### When should I use the builder vs derive APIs?
+//!
+//! Our default answer is to use the [Derive API][crate::_derive::_tutorial]:
+//! - Easier to read, write, and modify
+//! - Easier to keep the argument declaration and reading of argument in sync
+//! - Easier to reuse, e.g. [clap-verbosity-flag](https://crates.io/crates/clap-verbosity-flag)
+//!
+//! The [Builder API][crate::_tutorial] is a lower-level API that someone might want to use for
+//! - Faster compile times if you aren't already using other procedural macros
+//! - More flexibility, e.g. you can look up an [arguments values][crate::ArgMatches::get_many],
+//! their [ordering with other arguments][crate::ArgMatches::indices_of], and [what set
+//! them][crate::ArgMatches::value_source]. The Derive API can only report values and not
+//! indices of or other data.
+//!
+//! You can [interop between Derive and Builder APIs][crate::_derive#mixing-builder-and-derive-apis].
+//!
+//! ### Why is there a default subcommand of help?
+//!
+//! There is only a default subcommand of `help` when other subcommands have been defined manually. So it's opt-in(ish), being that you only get a `help` subcommand if you're actually using subcommands.
+//!
+//! Also, if the user defined a `help` subcommand themselves, the auto-generated one wouldn't be added (meaning it's only generated if the user hasn't defined one themselves).
+//!
diff --git a/vendor/clap-3.2.20/src/_features.rs b/vendor/clap-3.2.20/src/_features.rs
new file mode 100644
index 000000000..923134c45
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_features.rs
@@ -0,0 +1,27 @@
+//! ## Documentation: Feature Flags
+//!
+//! Available [compile-time feature flags](https://doc.rust-lang.org/cargo/reference/features.html#dependency-features)
+//!
+//! #### Default Features
+//!
+//! * **std**: _Not Currently Used._ Placeholder for supporting `no_std` environments in a backwards compatible manner.
+//! * **color**: Turns on colored error messages.
+//! * **suggestions**: Turns on the `Did you mean '--myoption'?` feature for when users make typos.
+//!
+//! #### Optional features
+//!
+//! * **deprecated**: Guided experience to prepare for next breaking release (at different stages of development, this may become default)
+//! * **derive**: Enables the custom derive (i.e. `#[derive(Parser)]`). Without this you must use one of the other methods of creating a `clap` CLI listed above.
+//! * **cargo**: Turns on macros that read values from [`CARGO_*` environment variables](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates).
+//! * **env**: Turns on the usage of environment variables during parsing.
+//! * **regex**: Enables regex validators.
+//! * **unicode**: Turns on support for unicode characters (including emoji) in arguments and help messages.
+//! * **wrap_help**: Turns on the help text wrapping feature, based on the terminal size.
+//!
+//! #### Experimental features
+//!
+//! **Warning:** These may contain breaking changes between minor releases.
+//!
+//! * **unstable-replace**: Enable [`Command::replace`](https://github.com/clap-rs/clap/issues/2836)
+//! * **unstable-grouped**: Enable [`ArgMatches::grouped_values_of`](https://github.com/clap-rs/clap/issues/2924)
+//! * **unstable-v4**: Preview features which will be stable on the v4.0 release
diff --git a/vendor/clap-3.2.20/src/_tutorial.rs b/vendor/clap-3.2.20/src/_tutorial.rs
new file mode 100644
index 000000000..9dbfc6864
--- /dev/null
+++ b/vendor/clap-3.2.20/src/_tutorial.rs
@@ -0,0 +1,204 @@
+// Contributing
+//
+// New example code:
+// - Please update the corresponding section in the derive tutorial
+// - Building: They must be added to `Cargo.toml` with the appropriate `required-features`.
+// - Testing: Ensure there is a markdown file with [trycmd](https://docs.rs/trycmd) syntax
+//
+// See also the general CONTRIBUTING
+
+//! # Documentation: Builder Tutorial
+//!
+//! 1. [Quick Start](#quick-start)
+//! 2. [Configuring the Parser](#configuring-the-parser)
+//! 3. [Adding Arguments](#adding-arguments)
+//! 1. [Positionals](#positionals)
+//! 2. [Options](#options)
+//! 3. [Flags](#flags)
+//! 4. [Subcommands](#subcommands)
+//! 5. [Defaults](#defaults)
+//! 4. Validation
+//! 1. [Enumerated values](#enumerated-values)
+//! 2. [Validated values](#validated-values)
+//! 3. [Argument Relations](#argument-relations)
+//! 4. [Custom Validation](#custom-validation)
+//! 5. [Testing](#testing)
+//!
+//! See also
+//! - [FAQ: When should I use the builder vs derive APIs?][crate::_faq#when-should-i-use-the-builder-vs-derive-apis]
+//! - The [cookbook][crate::_cookbook] for more application-focused examples
+//!
+//! ## Quick Start
+//!
+//! You can create an application with several arguments using usage strings.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/01_quick.rs")]
+//! ```
+//!
+#![doc = include_str!("../examples/tutorial_builder/01_quick.md")]
+//!
+//! ## Configuring the Parser
+//!
+//! You use [`Command`][crate::Command] to start building a parser.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/02_apps.rs")]
+//! ```
+//!
+#![doc = include_str!("../examples/tutorial_builder/02_apps.md")]
+//!
+//! You can use [`command!()`][crate::command!] to fill these fields in from your `Cargo.toml`
+//! file. **This requires the [`cargo` feature flag][crate::_features].**
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/02_crate.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/02_crate.md")]
+//!
+//! You can use [`Command`][crate::Command] methods to change the application level behavior of
+//! clap.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/02_app_settings.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/02_app_settings.md")]
+//!
+//! ## Adding Arguments
+//!
+//! ### Positionals
+//!
+//! You can have users specify values by their position on the command-line:
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/03_03_positional.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/03_03_positional.md")]
+//!
+//! ### Options
+//!
+//! You can name your arguments with a flag:
+//! - Order doesn't matter
+//! - They can be optional
+//! - Intent is clearer
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/03_02_option.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/03_02_option.md")]
+//!
+//! ### Flags
+//!
+//! Flags can also be switches that can be on/off:
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/03_01_flag_bool.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/03_01_flag_bool.md")]
+//!
+//! Or counted.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/03_01_flag_count.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/03_01_flag_count.md")]
+//!
+//! ### Subcommands
+//!
+//! Subcommands are defined as [`Command`][crate::Command]s that get added via
+//! [`Command::subcommand`][crate::Command::subcommand]. Each instance of a Subcommand can have its
+//! own version, author(s), Args, and even its own subcommands.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/03_04_subcommands.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/03_04_subcommands.md")]
+//!
+//! ### Defaults
+//!
+//! We've previously showed that arguments can be [`required`][crate::Arg::required] or optional.
+//! When optional, you work with a `Option` and can `unwrap_or`. Alternatively, you can set
+//! [`Arg::default_value`][crate::Arg::default_value].
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/03_05_default_values.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/03_05_default_values.md")]
+//!
+//! ## Validation
+//!
+//! ### Enumerated values
+//!
+//! If you have arguments of specific values you want to test for, you can use the
+//! [`PossibleValuesParser`][crate::builder::PossibleValuesParser] or [`Arg::value_parser(["val1",
+//! ...])`][crate::Arg::value_parser] for short.
+//!
+//! This allows you specify the valid values for that argument. If the user does not use one of
+//! those specific values, they will receive a graceful exit with error message informing them
+//! of the mistake, and what the possible valid values are
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/04_01_possible.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/04_01_possible.md")]
+//!
+//! When enabling the [`derive` feature][crate::_features], you can use
+//! [`ValueEnum`][crate::ValueEnum] to take care of the boiler plate for you, giving the same
+//! results.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/04_01_enum.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/04_01_enum.md")]
+//!
+//! ### Validated values
+//!
+//! More generally, you can validate and parse into any data type.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/04_02_parse.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/04_02_parse.md")]
+//!
+//! A custom parser can be used to improve the error messages or provide additional validation:
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/04_02_validate.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/04_02_validate.md")]
+//!
+//! ### Argument Relations
+//!
+//! You can declare dependencies or conflicts between [`Arg`][crate::Arg]s or even
+//! [`ArgGroup`][crate::ArgGroup]s.
+//!
+//! [`ArgGroup`][crate::ArgGroup]s make it easier to declare relations instead of having to list
+//! each individually, or when you want a rule to apply "any but not all" arguments.
+//!
+//! Perhaps the most common use of [`ArgGroup`][crate::ArgGroup]s is to require one and *only* one
+//! argument to be present out of a given set. Imagine that you had multiple arguments, and you
+//! want one of them to be required, but making all of them required isn't feasible because perhaps
+//! they conflict with each other.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/04_03_relations.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/04_03_relations.md")]
+//!
+//! ### Custom Validation
+//!
+//! As a last resort, you can create custom errors with the basics of clap's formatting.
+//!
+//! ```rust
+#![doc = include_str!("../examples/tutorial_builder/04_04_custom.rs")]
+//! ```
+#![doc = include_str!("../examples/tutorial_builder/04_04_custom.md")]
+//!
+//! ## Testing
+//!
+//! clap reports most development errors as `debug_assert!`s. Rather than checking every
+//! subcommand, you should have a test that calls
+//! [`Command::debug_assert`][crate::App::debug_assert]:
+//! ```rust,no_run
+#![doc = include_str!("../examples/tutorial_builder/05_01_assert.rs")]
+//! ```
diff --git a/vendor/clap/src/bin/stdio-fixture.rs b/vendor/clap-3.2.20/src/bin/stdio-fixture.rs
index e3f34b41a..e3f34b41a 100644
--- a/vendor/clap/src/bin/stdio-fixture.rs
+++ b/vendor/clap-3.2.20/src/bin/stdio-fixture.rs
diff --git a/vendor/clap/src/builder/action.rs b/vendor/clap-3.2.20/src/builder/action.rs
index ab3314290..71a91a8b1 100644
--- a/vendor/clap/src/builder/action.rs
+++ b/vendor/clap-3.2.20/src/builder/action.rs
@@ -183,16 +183,16 @@ pub enum ArgAction {
/// assert!(matches.contains_id("flag"));
/// assert_eq!(matches.occurrences_of("flag"), 0);
/// assert_eq!(
- /// matches.get_one::<u8>("flag").copied(),
- /// Some(2)
+ /// matches.get_count("flag"),
+ /// 2
/// );
///
/// let matches = cmd.try_get_matches_from(["mycmd"]).unwrap();
/// assert!(matches.contains_id("flag"));
/// assert_eq!(matches.occurrences_of("flag"), 0);
/// assert_eq!(
- /// matches.get_one::<u8>("flag").copied(),
- /// Some(0)
+ /// matches.get_count("flag"),
+ /// 0
/// );
/// ```
Count,
diff --git a/vendor/clap/src/builder/app_settings.rs b/vendor/clap-3.2.20/src/builder/app_settings.rs
index e2d9ba6b1..88bc243c4 100644
--- a/vendor/clap/src/builder/app_settings.rs
+++ b/vendor/clap-3.2.20/src/builder/app_settings.rs
@@ -400,23 +400,20 @@ pub enum AppSettings {
)]
NoAutoVersion,
- /// Deprecated, replaced with [`AppSettings::AllowHyphenValues`]
+ /// Deprecated, replaced with [`Command::allow_hyphen_values`]
#[cfg_attr(
feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Replaced with `AppSettings::AllowHyphenValues`"
- )
+ deprecated(since = "3.0.0", note = "Replaced with `Command::allow_hyphen_values`")
)]
#[doc(hidden)]
AllowLeadingHyphen,
- /// Deprecated, this is now the default, see [`AppSettings::AllowInvalidUtf8ForExternalSubcommands`] and [`ArgSettings::AllowInvalidUtf8`][crate::ArgSettings::AllowInvalidUtf8] for the opposite.
+ /// Deprecated, replaced with [`Command::allow_invalid_utf8_for_external_subcommands`] and [`Command::is_allow_invalid_utf8_for_external_subcommands_set`]
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "This is now the default see `AppSettings::AllowInvalidUtf8ForExternalSubcommands` and `ArgSettings::AllowInvalidUtf8` for the opposite."
+ note = "Replaced with `Command::allow_invalid_utf8_for_external_subcommands` and `Command::is_allow_invalid_utf8_for_external_subcommands_set`"
)
)]
#[doc(hidden)]
@@ -462,42 +459,47 @@ pub enum AppSettings {
#[doc(hidden)]
ColorNever,
- /// Deprecated, replaced with [`AppSettings::DisableHelpFlag`]
+ /// Deprecated, replaced with [`Command::disable_help_flag`] and [`Command::is_disable_help_flag_set`]
#[cfg_attr(
feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `AppSettings::DisableHelpFlag`")
+ deprecated(
+ since = "3.0.0",
+ note = "Replaced with `Command::disable_help_flag` and `Command::is_disable_help_flag_set`"
+ )
)]
#[doc(hidden)]
DisableHelpFlags,
- /// Deprecated, replaced with [`AppSettings::DisableVersionFlag`]
+ /// Deprecated, replaced with [`Command::disable_version_flag`] and
+ /// [`Command::is_disable_version_flag_set`]
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "Replaced with `AppSettings::DisableVersionFlag`"
+ note = "Replaced with `Command::disable_version_flag` and `Command::is_disable_version_flag_set`"
)
)]
#[doc(hidden)]
DisableVersion,
- /// Deprecated, replaced with [`AppSettings::PropagateVersion`]
+ /// Deprecated, replaced with [`Command::propagate_version`] and [`Command::is_propagate_version_set`]
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "Replaced with `AppSettings::PropagateVersion`"
+ note = "Replaced with `Command::propagate_version` and `Command::is_propagate_version_set`"
)
)]
#[doc(hidden)]
GlobalVersion,
- /// Deprecated, replaced with [`AppSettings::HidePossibleValues`]
+ /// Deprecated, replaced with [`Command::hide_possible_values`] and
+ /// [`Arg::is_hide_possible_values_set`]
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "Replaced with AppSettings::HidePossibleValues"
+ note = "Replaced with `Command::hide_possible_values` and `Arg::is_hide_possible_values_set`"
)
)]
#[doc(hidden)]
diff --git a/vendor/clap/src/builder/arg.rs b/vendor/clap-3.2.20/src/builder/arg.rs
index 63e88e80e..e9403d0b7 100644
--- a/vendor/clap/src/builder/arg.rs
+++ b/vendor/clap-3.2.20/src/builder/arg.rs
@@ -4316,6 +4316,16 @@ impl<'help> Arg<'help> {
}
}
+ /// Get *all* short aliases for this argument, if any, both visible and hidden.
+ #[inline]
+ pub fn get_all_short_aliases(&self) -> Option<Vec<char>> {
+ if self.short_aliases.is_empty() {
+ None
+ } else {
+ Some(self.short_aliases.iter().map(|(s, _)| s).copied().collect())
+ }
+ }
+
/// Get the short option name and its visible aliases, if any
#[inline]
pub fn get_short_and_visible_aliases(&self) -> Option<Vec<char>> {
@@ -4351,6 +4361,16 @@ impl<'help> Arg<'help> {
}
}
+ /// Get *all* aliases for this argument, if any, both visible and hidden.
+ #[inline]
+ pub fn get_all_aliases(&self) -> Option<Vec<&'help str>> {
+ if self.aliases.is_empty() {
+ None
+ } else {
+ Some(self.aliases.iter().map(|(s, _)| s).copied().collect())
+ }
+ }
+
/// Get the long option name and its visible aliases, if any
#[inline]
pub fn get_long_and_visible_aliases(&self) -> Option<Vec<&'help str>> {
diff --git a/vendor/clap/src/builder/arg_group.rs b/vendor/clap-3.2.20/src/builder/arg_group.rs
index 0fe317109..0fe317109 100644
--- a/vendor/clap/src/builder/arg_group.rs
+++ b/vendor/clap-3.2.20/src/builder/arg_group.rs
diff --git a/vendor/clap/src/builder/arg_predicate.rs b/vendor/clap-3.2.20/src/builder/arg_predicate.rs
index 58eb5494c..58eb5494c 100644
--- a/vendor/clap/src/builder/arg_predicate.rs
+++ b/vendor/clap-3.2.20/src/builder/arg_predicate.rs
diff --git a/vendor/clap/src/builder/arg_settings.rs b/vendor/clap-3.2.20/src/builder/arg_settings.rs
index 3b7faf7bf..ecc064caa 100644
--- a/vendor/clap/src/builder/arg_settings.rs
+++ b/vendor/clap-3.2.20/src/builder/arg_settings.rs
@@ -50,14 +50,10 @@ pub enum ArgSettings {
)
)]
MultipleValues,
- /// Deprecated, replaced with [`Arg::multiple_occurrences`] and
- /// [`Arg::is_multiple_occurrences_set`]
+ /// Deprecated, replaced with [`Arg::action`] ([Issue #3772](https://github.com/clap-rs/clap/issues/3772))
#[cfg_attr(
feature = "deprecated",
- deprecated(
- since = "3.1.0",
- note = "Replaced with `Arg::multiple_occurrences` and `Arg::is_multiple_occurrences_set`"
- )
+ deprecated(since = "3.1.0", note = "Replaced with `Arg::action` (Issue #3772)")
)]
MultipleOccurrences,
/// Deprecated, see [`ArgSettings::MultipleOccurrences`] (most likely what you want) and
@@ -66,18 +62,17 @@ pub enum ArgSettings {
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "Split into `ArgSettings::MultipleOccurrences` (most likely what you want) and `ArgSettings::MultipleValues`"
+ note = "Split into `Arg::multiple_occurrences` (most likely what you want) and `Arg::multiple_values`"
)
)]
#[doc(hidden)]
Multiple,
- /// Deprecated, replaced with [`Arg::forbid_empty_values`] and
- /// [`Arg::is_forbid_empty_values_set`]
+ /// Deprecated, replaced with [`Arg::value_parser(NonEmptyStringValueParser::new())`]
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.1.0",
- note = "Replaced with `Arg::forbid_empty_values` and `Arg::is_forbid_empty_values_set`"
+ note = "Replaced with `Arg::value_parser(NonEmptyStringValueParser::new())`"
)
)]
ForbidEmptyValues,
@@ -157,12 +152,13 @@ pub enum ArgSettings {
)
)]
AllowHyphenValues,
- /// Deprecated, replaced with [`ArgSettings::AllowHyphenValues`]
+ /// Deprecated, replaced with [`Arg::allow_hyphen_values`] and
+ /// [`Arg::is_allow_hyphen_values_set`]
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "Replaced with `ArgSettings::AllowHyphenValues`"
+ note = "Replaced with `Arg::allow_hyphen_values` and `Arg::is_allow_hyphen_values_set`"
)
)]
#[doc(hidden)]
@@ -203,10 +199,13 @@ pub enum ArgSettings {
)
)]
IgnoreCase,
- /// Deprecated, replaced with [`ArgSettings::IgnoreCase`]
+ /// Deprecated, replaced with [`Arg::ignore_case`] and [`Arg::is_ignore_case_set`]
#[cfg_attr(
feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `ArgSettings::IgnoreCase`")
+ deprecated(
+ since = "3.0.0",
+ note = "Replaced with `Arg::ignore_case` and `Arg::is_ignore_case_set`"
+ )
)]
#[doc(hidden)]
CaseInsensitive,
diff --git a/vendor/clap/src/builder/command.rs b/vendor/clap-3.2.20/src/builder/command.rs
index 1fcb64ecc..de59ad8cd 100644
--- a/vendor/clap/src/builder/command.rs
+++ b/vendor/clap-3.2.20/src/builder/command.rs
@@ -274,6 +274,50 @@ impl<'help> App<'help> {
self
}
+ /// Allows one to mutate a [`Command`] after it's been added as a subcommand.
+ ///
+ /// This can be useful for modifying auto-generated arguments of nested subcommands with
+ /// [`Command::mut_arg`].
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::Command;
+ ///
+ /// let mut cmd = Command::new("foo")
+ /// .subcommand(Command::new("bar"))
+ /// .mut_subcommand("bar", |subcmd| subcmd.disable_help_flag(true));
+ ///
+ /// let res = cmd.try_get_matches_from_mut(vec!["foo", "bar", "--help"]);
+ ///
+ /// // Since we disabled the help flag on the "bar" subcommand, this should err.
+ ///
+ /// assert!(res.is_err());
+ ///
+ /// let res = cmd.try_get_matches_from_mut(vec!["foo", "bar"]);
+ /// assert!(res.is_ok());
+ /// ```
+ #[must_use]
+ pub fn mut_subcommand<'a, T, F>(mut self, subcmd_id: T, f: F) -> Self
+ where
+ F: FnOnce(App<'help>) -> App<'help>,
+ T: Into<&'a str>,
+ {
+ let subcmd_id: &str = subcmd_id.into();
+ let id = Id::from(subcmd_id);
+
+ let pos = self.subcommands.iter().position(|s| s.id == id);
+
+ let subcmd = if let Some(idx) = pos {
+ self.subcommands.remove(idx)
+ } else {
+ App::new(subcmd_id)
+ };
+
+ self.subcommands.push(f(subcmd));
+ self
+ }
+
/// Adds an [`ArgGroup`] to the application.
///
/// [`ArgGroup`]s are a family of related arguments.
@@ -700,7 +744,7 @@ impl<'help> App<'help> {
/// [`io::stdout()`]: std::io::stdout()
pub fn print_help(&mut self) -> io::Result<()> {
self._build_self();
- let color = self.get_color();
+ let color = self.color_help();
let mut c = Colorizer::new(Stream::Stdout, color);
let usage = Usage::new(self);
@@ -725,7 +769,7 @@ impl<'help> App<'help> {
/// [`--help` (long)]: Arg::long_help()
pub fn print_long_help(&mut self) -> io::Result<()> {
self._build_self();
- let color = self.get_color();
+ let color = self.color_help();
let mut c = Colorizer::new(Stream::Stdout, color);
let usage = Usage::new(self);
@@ -1604,6 +1648,14 @@ impl<'help> App<'help> {
/// strings. After this setting is set, this will be *the only* usage string
/// displayed to the user!
///
+ /// **NOTE:** Multiple usage lines may be present in the usage argument, but
+ /// some rules need to be followed to ensure the usage lines are formatted
+ /// correctly by the default help formatter:
+ ///
+ /// - Do not indent the first usage line.
+ /// - Indent all subsequent usage lines with four spaces.
+ /// - The last line must not end with a newline.
+ ///
/// # Examples
///
/// ```no_run
@@ -1612,6 +1664,20 @@ impl<'help> App<'help> {
/// .override_usage("myapp [-clDas] <some_file>")
/// # ;
/// ```
+ ///
+ /// Or for multiple usage lines:
+ ///
+ /// ```no_run
+ /// # use clap::{Command, Arg};
+ /// Command::new("myprog")
+ /// .override_usage(
+ /// "myapp -X [-a] [-b] <file>\n \
+ /// myapp -Y [-c] <file1> <file2>\n \
+ /// myapp -Z [-d|-e]"
+ /// )
+ /// # ;
+ /// ```
+ ///
/// [`ArgMatches::usage`]: ArgMatches::usage()
#[must_use]
pub fn override_usage<S: Into<&'help str>>(mut self, usage: S) -> Self {
@@ -3512,15 +3578,21 @@ impl<'help> App<'help> {
if arg.is_global_set() {
self.get_global_arg_conflicts_with(arg)
} else {
- arg.blacklist
- .iter()
- .map(|id| {
- self.args.args().find(|arg| arg.id == *id).expect(
- "Command::get_arg_conflicts_with: \
- The passed arg conflicts with an arg unknown to the cmd",
- )
- })
- .collect()
+ let mut result = Vec::new();
+ for id in arg.blacklist.iter() {
+ if let Some(arg) = self.find(id) {
+ result.push(arg);
+ } else if let Some(group) = self.find_group(id) {
+ result.extend(
+ self.unroll_args_in_group(&group.id)
+ .iter()
+ .map(|id| self.find(id).expect(INTERNAL_ERROR_MSG)),
+ );
+ } else {
+ panic!("Command::get_arg_conflicts_with: The passed arg conflicts with an arg unknown to the cmd");
+ }
+ }
+ result
}
}
@@ -4264,7 +4336,8 @@ impl<'help> App<'help> {
use std::fmt::Write;
let mut mid_string = String::from(" ");
- if !self.is_subcommand_negates_reqs_set() {
+ if !self.is_subcommand_negates_reqs_set() && !self.is_args_conflicts_with_subcommands_set()
+ {
let reqs = Usage::new(self).get_required_usage_from(&[], None, true); // maybe Some(m)
for s in &reqs {
@@ -4347,7 +4420,9 @@ impl<'help> App<'help> {
if !self.is_set(AppSettings::BinNameBuilt) {
let mut mid_string = String::from(" ");
- if !self.is_subcommand_negates_reqs_set() {
+ if !self.is_subcommand_negates_reqs_set()
+ && !self.is_args_conflicts_with_subcommands_set()
+ {
let reqs = Usage::new(self).get_required_usage_from(&[], None, true); // maybe Some(m)
for s in &reqs {
@@ -5107,3 +5182,8 @@ where
_ => None,
}
}
+
+#[test]
+fn check_auto_traits() {
+ static_assertions::assert_impl_all!(Command: Send, Sync, Unpin);
+}
diff --git a/vendor/clap/src/builder/debug_asserts.rs b/vendor/clap-3.2.20/src/builder/debug_asserts.rs
index 864b8b479..864b8b479 100644
--- a/vendor/clap/src/builder/debug_asserts.rs
+++ b/vendor/clap-3.2.20/src/builder/debug_asserts.rs
diff --git a/vendor/clap/src/builder/macros.rs b/vendor/clap-3.2.20/src/builder/macros.rs
index 5be4d205e..5be4d205e 100644
--- a/vendor/clap/src/builder/macros.rs
+++ b/vendor/clap-3.2.20/src/builder/macros.rs
diff --git a/vendor/clap/src/builder/mod.rs b/vendor/clap-3.2.20/src/builder/mod.rs
index 4f24c74d3..4f24c74d3 100644
--- a/vendor/clap/src/builder/mod.rs
+++ b/vendor/clap-3.2.20/src/builder/mod.rs
diff --git a/vendor/clap/src/builder/possible_value.rs b/vendor/clap-3.2.20/src/builder/possible_value.rs
index 1c14217a6..1c14217a6 100644
--- a/vendor/clap/src/builder/possible_value.rs
+++ b/vendor/clap-3.2.20/src/builder/possible_value.rs
diff --git a/vendor/clap/src/builder/regex.rs b/vendor/clap-3.2.20/src/builder/regex.rs
index bf3a78e0c..bf3a78e0c 100644
--- a/vendor/clap/src/builder/regex.rs
+++ b/vendor/clap-3.2.20/src/builder/regex.rs
diff --git a/vendor/clap/src/builder/tests.rs b/vendor/clap-3.2.20/src/builder/tests.rs
index 76c8b8785..76c8b8785 100644
--- a/vendor/clap/src/builder/tests.rs
+++ b/vendor/clap-3.2.20/src/builder/tests.rs
diff --git a/vendor/clap/src/builder/usage_parser.rs b/vendor/clap-3.2.20/src/builder/usage_parser.rs
index 85d0d304e..85d0d304e 100644
--- a/vendor/clap/src/builder/usage_parser.rs
+++ b/vendor/clap-3.2.20/src/builder/usage_parser.rs
diff --git a/vendor/clap/src/builder/value_hint.rs b/vendor/clap-3.2.20/src/builder/value_hint.rs
index 7c35d1eb3..7c35d1eb3 100644
--- a/vendor/clap/src/builder/value_hint.rs
+++ b/vendor/clap-3.2.20/src/builder/value_hint.rs
diff --git a/vendor/clap/src/builder/value_parser.rs b/vendor/clap-3.2.20/src/builder/value_parser.rs
index 397537c9f..0492f2782 100644
--- a/vendor/clap/src/builder/value_parser.rs
+++ b/vendor/clap-3.2.20/src/builder/value_parser.rs
@@ -12,7 +12,7 @@ use crate::parser::AnyValueId;
/// use within an application.
///
/// See
-/// - [`value_parser!`] for automatically selecting an implementation for a given type
+/// - [`value_parser!`][crate::value_parser] for automatically selecting an implementation for a given type
/// - [`ValueParser::new`] for additional [`TypedValueParser`] that can be used
///
/// # Example
diff --git a/vendor/clap/src/derive.rs b/vendor/clap-3.2.20/src/derive.rs
index bfb7bdfa2..b6ac04df6 100644
--- a/vendor/clap/src/derive.rs
+++ b/vendor/clap-3.2.20/src/derive.rs
@@ -19,11 +19,9 @@ use std::ffi::OsString;
///
/// See also [`Subcommand`] and [`Args`].
///
-/// See the
-/// [derive reference](https://github.com/clap-rs/clap/blob/v3.2.5/examples/derive_ref/README.md)
-/// for attributes and best practices.
+/// See the [derive reference](crate::_derive) for attributes and best practices.
///
-/// **NOTE:** Deriving requires the `derive` feature flag
+/// **NOTE:** Deriving requires the [`derive` feature flag][crate::_features]
///
/// # Examples
///
@@ -156,13 +154,13 @@ pub trait Parser: FromArgMatches + CommandFactory + Sized {
.map_err(format_error::<Self>)
}
- /// Deprecated, `StructOpt::clap` replaced with [`IntoCommand::command`] (derive as part of
+ /// Deprecated, `StructOpt::clap` replaced with [`CommandFactory::command`] (derive as part of
/// [`Parser`])
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.0.0",
- note = "`StructOpt::clap` is replaced with `IntoCommand::command` (derived as part of `Parser`)"
+ note = "`StructOpt::clap` is replaced with `CommandFactory::command` (derived as part of `Parser`)"
)
)]
#[doc(hidden)]
@@ -372,11 +370,9 @@ pub trait FromArgMatches: Sized {
/// `Args`.
/// - `Variant(ChildArgs)`: No attribute is used with enum variants that impl `Args`.
///
-/// See the
-/// [derive reference](https://github.com/clap-rs/clap/blob/v3.2.5/examples/derive_ref/README.md)
-/// for attributes and best practices.
+/// See the [derive reference](crate::_derive) for attributes and best practices.
///
-/// **NOTE:** Deriving requires the `derive` feature flag
+/// **NOTE:** Deriving requires the [`derive` feature flag][crate::_features]
///
/// # Example
///
@@ -416,11 +412,9 @@ pub trait Args: FromArgMatches + Sized {
/// - `#[clap(flatten)] Variant(SubCmd)`: Attribute can only be used with enum variants that impl
/// `Subcommand`.
///
-/// See the
-/// [derive reference](https://github.com/clap-rs/clap/blob/v3.2.5/examples/derive_ref/README.md)
-/// for attributes and best practices.
+/// See the [derive reference](crate::_derive) for attributes and best practices.
///
-/// **NOTE:** Deriving requires the `derive` feature flag
+/// **NOTE:** Deriving requires the [`derive` feature flag][crate::_features]
///
/// # Example
///
@@ -460,11 +454,9 @@ pub trait Subcommand: FromArgMatches + Sized {
/// - Call [`Arg::possible_values`][crate::Arg::possible_values]
/// - Allowing using the `#[clap(default_value_t)]` attribute without implementing `Display`.
///
-/// See the
-/// [derive reference](https://github.com/clap-rs/clap/blob/v3.2.5/examples/derive_ref/README.md)
-/// for attributes and best practices.
+/// See the [derive reference](crate::_derive) for attributes and best practices.
///
-/// **NOTE:** Deriving requires the `derive` feature flag
+/// **NOTE:** Deriving requires the [`derive` feature flag][crate::_features]
///
/// # Example
///
diff --git a/vendor/clap/src/error/context.rs b/vendor/clap-3.2.20/src/error/context.rs
index 985cd4d70..985cd4d70 100644
--- a/vendor/clap/src/error/context.rs
+++ b/vendor/clap-3.2.20/src/error/context.rs
diff --git a/vendor/clap-3.2.20/src/error/kind.rs b/vendor/clap-3.2.20/src/error/kind.rs
new file mode 100644
index 000000000..4c3dc48b0
--- /dev/null
+++ b/vendor/clap-3.2.20/src/error/kind.rs
@@ -0,0 +1,440 @@
+/// Command line argument parser kind of error
+#[derive(Debug, Copy, Clone, PartialEq)]
+#[non_exhaustive]
+pub enum ErrorKind {
+ /// Occurs when an [`Arg`][crate::Arg] has a set of possible values,
+ /// and the user provides a value which isn't in that set.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("speed")
+ /// .value_parser(["fast", "slow"]))
+ /// .try_get_matches_from(vec!["prog", "other"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
+ /// ```
+ InvalidValue,
+
+ /// Occurs when a user provides a flag, option, argument or subcommand which isn't defined.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(arg!(--flag "some flag"))
+ /// .try_get_matches_from(vec!["prog", "--other"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::UnknownArgument);
+ /// ```
+ UnknownArgument,
+
+ /// Occurs when the user provides an unrecognized [`Subcommand`] which meets the threshold for
+ /// being similar enough to an existing subcommand.
+ /// If it doesn't meet the threshold, or the 'suggestions' feature is disabled,
+ /// the more general [`UnknownArgument`] error is returned.
+ ///
+ /// # Examples
+ ///
+ #[cfg_attr(not(feature = "suggestions"), doc = " ```no_run")]
+ #[cfg_attr(feature = "suggestions", doc = " ```")]
+ /// # use clap::{Command, Arg, ErrorKind, };
+ /// let result = Command::new("prog")
+ /// .subcommand(Command::new("config")
+ /// .about("Used for configuration")
+ /// .arg(Arg::new("config_file")
+ /// .help("The configuration file to use")))
+ /// .try_get_matches_from(vec!["prog", "confi"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidSubcommand);
+ /// ```
+ ///
+ /// [`Subcommand`]: crate::Subcommand
+ /// [`UnknownArgument`]: ErrorKind::UnknownArgument
+ InvalidSubcommand,
+
+ /// Occurs when the user provides an unrecognized [`Subcommand`] which either
+ /// doesn't meet the threshold for being similar enough to an existing subcommand,
+ /// or the 'suggestions' feature is disabled.
+ /// Otherwise the more detailed [`InvalidSubcommand`] error is returned.
+ ///
+ /// This error typically happens when passing additional subcommand names to the `help`
+ /// subcommand. Otherwise, the more general [`UnknownArgument`] error is used.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind, };
+ /// let result = Command::new("prog")
+ /// .subcommand(Command::new("config")
+ /// .about("Used for configuration")
+ /// .arg(Arg::new("config_file")
+ /// .help("The configuration file to use")))
+ /// .try_get_matches_from(vec!["prog", "help", "nothing"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::UnrecognizedSubcommand);
+ /// ```
+ ///
+ /// [`Subcommand`]: crate::Subcommand
+ /// [`InvalidSubcommand`]: ErrorKind::InvalidSubcommand
+ /// [`UnknownArgument`]: ErrorKind::UnknownArgument
+ UnrecognizedSubcommand,
+
+ /// Occurs when the user provides an empty value for an option that does not allow empty
+ /// values.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let res = Command::new("prog")
+ /// .arg(Arg::new("color")
+ /// .takes_value(true)
+ /// .forbid_empty_values(true)
+ /// .long("color"))
+ /// .try_get_matches_from(vec!["prog", "--color="]);
+ /// assert!(res.is_err());
+ /// assert_eq!(res.unwrap_err().kind(), ErrorKind::EmptyValue);
+ /// ```
+ EmptyValue,
+
+ /// Occurs when the user doesn't use equals for an option that requires equal
+ /// sign to provide values.
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let res = Command::new("prog")
+ /// .arg(Arg::new("color")
+ /// .takes_value(true)
+ /// .require_equals(true)
+ /// .long("color"))
+ /// .try_get_matches_from(vec!["prog", "--color", "red"]);
+ /// assert!(res.is_err());
+ /// assert_eq!(res.unwrap_err().kind(), ErrorKind::NoEquals);
+ /// ```
+ NoEquals,
+
+ /// Occurs when the user provides a value for an argument with a custom validation and the
+ /// value fails that validation.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// fn is_numeric(val: &str) -> Result<(), String> {
+ /// match val.parse::<i64>() {
+ /// Ok(..) => Ok(()),
+ /// Err(..) => Err(String::from("Value wasn't a number!")),
+ /// }
+ /// }
+ ///
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("num")
+ /// .validator(is_numeric))
+ /// .try_get_matches_from(vec!["prog", "NotANumber"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::ValueValidation);
+ /// ```
+ ValueValidation,
+
+ /// Occurs when a user provides more values for an argument than were defined by setting
+ /// [`Arg::max_values`].
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("arg")
+ /// .max_values(2))
+ /// .try_get_matches_from(vec!["prog", "too", "many", "values"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::TooManyValues);
+ /// ```
+ /// [`Arg::max_values`]: crate::Arg::max_values()
+ TooManyValues,
+
+ /// Occurs when the user provides fewer values for an argument than were defined by setting
+ /// [`Arg::min_values`].
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("some_opt")
+ /// .long("opt")
+ /// .min_values(3))
+ /// .try_get_matches_from(vec!["prog", "--opt", "too", "few"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::TooFewValues);
+ /// ```
+ /// [`Arg::min_values`]: crate::Arg::min_values()
+ TooFewValues,
+
+ /// Occurs when a user provides more occurrences for an argument than were defined by setting
+ /// [`Arg::max_occurrences`].
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("verbosity")
+ /// .short('v')
+ /// .max_occurrences(2))
+ /// .try_get_matches_from(vec!["prog", "-vvv"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::TooManyOccurrences);
+ /// ```
+ /// [`Arg::max_occurrences`]: crate::Arg::max_occurrences()
+ TooManyOccurrences,
+
+ /// Occurs when the user provides a different number of values for an argument than what's
+ /// been defined by setting [`Arg::number_of_values`] or than was implicitly set by
+ /// [`Arg::value_names`].
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("some_opt")
+ /// .long("opt")
+ /// .takes_value(true)
+ /// .number_of_values(2))
+ /// .try_get_matches_from(vec!["prog", "--opt", "wrong"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::WrongNumberOfValues);
+ /// ```
+ ///
+ /// [`Arg::number_of_values`]: crate::Arg::number_of_values()
+ /// [`Arg::value_names`]: crate::Arg::value_names()
+ WrongNumberOfValues,
+
+ /// Occurs when the user provides two values which conflict with each other and can't be used
+ /// together.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("debug")
+ /// .long("debug")
+ /// .conflicts_with("color"))
+ /// .arg(Arg::new("color")
+ /// .long("color"))
+ /// .try_get_matches_from(vec!["prog", "--debug", "--color"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
+ /// ```
+ ArgumentConflict,
+
+ /// Occurs when the user does not provide one or more required arguments.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("debug")
+ /// .required(true))
+ /// .try_get_matches_from(vec!["prog"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::MissingRequiredArgument);
+ /// ```
+ MissingRequiredArgument,
+
+ /// Occurs when a subcommand is required (as defined by [`Command::subcommand_required`]),
+ /// but the user does not provide one.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, ErrorKind};
+ /// let err = Command::new("prog")
+ /// .subcommand_required(true)
+ /// .subcommand(Command::new("test"))
+ /// .try_get_matches_from(vec![
+ /// "myprog",
+ /// ]);
+ /// assert!(err.is_err());
+ /// assert_eq!(err.unwrap_err().kind(), ErrorKind::MissingSubcommand);
+ /// # ;
+ /// ```
+ ///
+ /// [`Command::subcommand_required`]: crate::Command::subcommand_required
+ MissingSubcommand,
+
+ /// Occurs when the user provides multiple values to an argument which doesn't allow that.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("debug")
+ /// .long("debug")
+ /// .multiple_occurrences(false))
+ /// .try_get_matches_from(vec!["prog", "--debug", "--debug"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::UnexpectedMultipleUsage);
+ /// ```
+ UnexpectedMultipleUsage,
+
+ /// Occurs when the user provides a value containing invalid UTF-8.
+ ///
+ /// To allow arbitrary data
+ /// - Set [`Arg::allow_invalid_utf8`] for argument values
+ /// - Set [`Command::allow_invalid_utf8_for_external_subcommands`] for external-subcommand
+ /// values
+ ///
+ /// # Platform Specific
+ ///
+ /// Non-Windows platforms only (such as Linux, Unix, OSX, etc.)
+ ///
+ /// # Examples
+ ///
+ #[cfg_attr(not(unix), doc = " ```ignore")]
+ #[cfg_attr(unix, doc = " ```")]
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// # use std::os::unix::ffi::OsStringExt;
+ /// # use std::ffi::OsString;
+ /// let result = Command::new("prog")
+ /// .arg(Arg::new("utf8")
+ /// .short('u')
+ /// .takes_value(true))
+ /// .try_get_matches_from(vec![OsString::from("myprog"),
+ /// OsString::from("-u"),
+ /// OsString::from_vec(vec![0xE9])]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidUtf8);
+ /// ```
+ ///
+ /// [`Arg::allow_invalid_utf8`]: crate::Arg::allow_invalid_utf8
+ /// [`Command::allow_invalid_utf8_for_external_subcommands`]: crate::Command::allow_invalid_utf8_for_external_subcommands
+ InvalidUtf8,
+
+ /// Not a true "error" as it means `--help` or similar was used.
+ /// The help message will be sent to `stdout`.
+ ///
+ /// **Note**: If the help is displayed due to an error (such as missing subcommands) it will
+ /// be sent to `stderr` instead of `stdout`.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .try_get_matches_from(vec!["prog", "--help"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::DisplayHelp);
+ /// ```
+ DisplayHelp,
+
+ /// Occurs when either an argument or a [`Subcommand`] is required, as defined by
+ /// [`Command::arg_required_else_help`] , but the user did not provide
+ /// one.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind, };
+ /// let result = Command::new("prog")
+ /// .arg_required_else_help(true)
+ /// .subcommand(Command::new("config")
+ /// .about("Used for configuration")
+ /// .arg(Arg::new("config_file")
+ /// .help("The configuration file to use")))
+ /// .try_get_matches_from(vec!["prog"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand);
+ /// ```
+ ///
+ /// [`Subcommand`]: crate::Subcommand
+ /// [`Command::arg_required_else_help`]: crate::Command::arg_required_else_help
+ DisplayHelpOnMissingArgumentOrSubcommand,
+
+ /// Not a true "error" as it means `--version` or similar was used.
+ /// The message will be sent to `stdout`.
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::{Command, Arg, ErrorKind};
+ /// let result = Command::new("prog")
+ /// .version("3.0")
+ /// .try_get_matches_from(vec!["prog", "--version"]);
+ /// assert!(result.is_err());
+ /// assert_eq!(result.unwrap_err().kind(), ErrorKind::DisplayVersion);
+ /// ```
+ DisplayVersion,
+
+ /// Occurs when using the [`ArgMatches::value_of_t`] and friends to convert an argument value
+ /// into type `T`, but the argument you requested wasn't used. I.e. you asked for an argument
+ /// with name `config` to be converted, but `config` wasn't used by the user.
+ ///
+ /// [`ArgMatches::value_of_t`]: crate::ArgMatches::value_of_t()
+ ArgumentNotFound,
+
+ /// Represents an [I/O error].
+ /// Can occur when writing to `stderr` or `stdout` or reading a configuration file.
+ ///
+ /// [I/O error]: std::io::Error
+ Io,
+
+ /// Represents a [Format error] (which is a part of [`Display`]).
+ /// Typically caused by writing to `stderr` or `stdout`.
+ ///
+ /// [`Display`]: std::fmt::Display
+ /// [Format error]: std::fmt::Error
+ Format,
+}
+
+impl ErrorKind {
+ /// End-user description of the error case, where relevant
+ pub fn as_str(self) -> Option<&'static str> {
+ match self {
+ Self::InvalidValue => Some("One of the values isn't valid for an argument"),
+ Self::UnknownArgument => {
+ Some("Found an argument which wasn't expected or isn't valid in this context")
+ }
+ Self::InvalidSubcommand => Some("A subcommand wasn't recognized"),
+ Self::UnrecognizedSubcommand => Some("A subcommand wasn't recognized"),
+ Self::EmptyValue => Some("An argument requires a value but none was supplied"),
+ Self::NoEquals => Some("Equal is needed when assigning values to one of the arguments"),
+ Self::ValueValidation => Some("Invalid value for one of the arguments"),
+ Self::TooManyValues => Some("An argument received an unexpected value"),
+ Self::TooFewValues => Some("An argument requires more values"),
+ Self::TooManyOccurrences => Some("An argument occurred too many times"),
+ Self::WrongNumberOfValues => Some("An argument received too many or too few values"),
+ Self::ArgumentConflict => {
+ Some("An argument cannot be used with one or more of the other specified arguments")
+ }
+ Self::MissingRequiredArgument => {
+ Some("One or more required arguments were not provided")
+ }
+ Self::MissingSubcommand => Some("A subcommand is required but one was not provided"),
+ Self::UnexpectedMultipleUsage => {
+ Some("An argument was provided more than once but cannot be used multiple times")
+ }
+ Self::InvalidUtf8 => Some("Invalid UTF-8 was detected in one or more arguments"),
+ Self::DisplayHelp => None,
+ Self::DisplayHelpOnMissingArgumentOrSubcommand => None,
+ Self::DisplayVersion => None,
+ Self::ArgumentNotFound => Some("An argument wasn't found"),
+ Self::Io => None,
+ Self::Format => None,
+ }
+ }
+}
+
+impl std::fmt::Display for ErrorKind {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ self.as_str().unwrap_or_default().fmt(f)
+ }
+}
diff --git a/vendor/clap-3.2.20/src/error/mod.rs b/vendor/clap-3.2.20/src/error/mod.rs
new file mode 100644
index 000000000..fbd2b30a8
--- /dev/null
+++ b/vendor/clap-3.2.20/src/error/mod.rs
@@ -0,0 +1,1153 @@
+//! Error reporting
+#![allow(deprecated)]
+
+// Std
+use std::{
+ borrow::Cow,
+ convert::From,
+ error,
+ fmt::{self, Debug, Display, Formatter},
+ io::{self, BufRead},
+ result::Result as StdResult,
+};
+
+// Internal
+use crate::output::fmt::Colorizer;
+use crate::output::fmt::Stream;
+use crate::parser::features::suggestions;
+use crate::util::{color::ColorChoice, safe_exit, SUCCESS_CODE, USAGE_CODE};
+use crate::AppSettings;
+use crate::Command;
+
+mod context;
+mod kind;
+
+pub use context::ContextKind;
+pub use context::ContextValue;
+pub use kind::ErrorKind;
+
+/// Short hand for [`Result`] type
+///
+/// [`Result`]: std::result::Result
+pub type Result<T, E = Error> = StdResult<T, E>;
+
+/// Command Line Argument Parser Error
+///
+/// See [`Command::error`] to create an error.
+///
+/// [`Command::error`]: crate::Command::error
+#[derive(Debug)]
+pub struct Error {
+ inner: Box<ErrorInner>,
+ /// Deprecated, replaced with [`Error::kind()`]
+ #[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.1.0", note = "Replaced with `Error::kind()`")
+ )]
+ pub kind: ErrorKind,
+ /// Deprecated, replaced with [`Error::context()`]
+ #[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.1.0", note = "Replaced with `Error::context()`")
+ )]
+ pub info: Vec<String>,
+}
+
+#[derive(Debug)]
+struct ErrorInner {
+ kind: ErrorKind,
+ context: Vec<(ContextKind, ContextValue)>,
+ message: Option<Message>,
+ source: Option<Box<dyn error::Error + Send + Sync>>,
+ help_flag: Option<&'static str>,
+ color_when: ColorChoice,
+ wait_on_exit: bool,
+ backtrace: Option<Backtrace>,
+}
+
+impl Error {
+ /// Create an unformatted error
+ ///
+ /// This is for you need to pass the error up to
+ /// a place that has access to the `Command` at which point you can call [`Error::format`].
+ ///
+ /// Prefer [`Command::error`] for generating errors.
+ ///
+ /// [`Command::error`]: crate::Command::error
+ pub fn raw(kind: ErrorKind, message: impl std::fmt::Display) -> Self {
+ Self::new(kind).set_message(message.to_string())
+ }
+
+ /// Format the existing message with the Command's context
+ #[must_use]
+ pub fn format(mut self, cmd: &mut Command) -> Self {
+ cmd._build_self();
+ let usage = cmd.render_usage();
+ if let Some(message) = self.inner.message.as_mut() {
+ message.format(cmd, usage);
+ }
+ self.with_cmd(cmd)
+ }
+
+ /// Type of error for programmatic processing
+ pub fn kind(&self) -> ErrorKind {
+ self.inner.kind
+ }
+
+ /// Additional information to further qualify the error
+ pub fn context(&self) -> impl Iterator<Item = (ContextKind, &ContextValue)> {
+ self.inner.context.iter().map(|(k, v)| (*k, v))
+ }
+
+ /// Should the message be written to `stdout` or not?
+ #[inline]
+ pub fn use_stderr(&self) -> bool {
+ self.stream() == Stream::Stderr
+ }
+
+ pub(crate) fn stream(&self) -> Stream {
+ match self.kind() {
+ ErrorKind::DisplayHelp | ErrorKind::DisplayVersion => Stream::Stdout,
+ _ => Stream::Stderr,
+ }
+ }
+
+ /// Prints the error and exits.
+ ///
+ /// Depending on the error kind, this either prints to `stderr` and exits with a status of `2`
+ /// or prints to `stdout` and exits with a status of `0`.
+ pub fn exit(&self) -> ! {
+ if self.use_stderr() {
+ // Swallow broken pipe errors
+ let _ = self.print();
+
+ if self.inner.wait_on_exit {
+ wlnerr!("\nPress [ENTER] / [RETURN] to continue...");
+ let mut s = String::new();
+ let i = io::stdin();
+ i.lock().read_line(&mut s).unwrap();
+ }
+
+ safe_exit(USAGE_CODE);
+ }
+
+ // Swallow broken pipe errors
+ let _ = self.print();
+ safe_exit(SUCCESS_CODE)
+ }
+
+ /// Prints formatted and colored error to `stdout` or `stderr` according to its error kind
+ ///
+ /// # Example
+ /// ```no_run
+ /// use clap::Command;
+ ///
+ /// match Command::new("Command").try_get_matches() {
+ /// Ok(matches) => {
+ /// // do_something
+ /// },
+ /// Err(err) => {
+ /// err.print().expect("Error writing Error");
+ /// // do_something
+ /// },
+ /// };
+ /// ```
+ pub fn print(&self) -> io::Result<()> {
+ self.formatted().print()
+ }
+
+ /// Deprecated, replaced with [`Command::error`]
+ ///
+ /// [`Command::error`]: crate::Command::error
+ #[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `Command::error`")
+ )]
+ #[doc(hidden)]
+ pub fn with_description(description: String, kind: ErrorKind) -> Self {
+ Error::raw(kind, description)
+ }
+
+ fn new(kind: ErrorKind) -> Self {
+ Self {
+ inner: Box::new(ErrorInner {
+ kind,
+ context: Vec::new(),
+ message: None,
+ source: None,
+ help_flag: None,
+ color_when: ColorChoice::Never,
+ wait_on_exit: false,
+ backtrace: Backtrace::new(),
+ }),
+ kind,
+ info: vec![],
+ }
+ }
+
+ #[inline(never)]
+ fn for_app(kind: ErrorKind, cmd: &Command, colorizer: Colorizer, info: Vec<String>) -> Self {
+ Self::new(kind)
+ .set_message(colorizer)
+ .with_cmd(cmd)
+ .set_info(info)
+ }
+
+ pub(crate) fn with_cmd(self, cmd: &Command) -> Self {
+ self.set_wait_on_exit(cmd.is_set(AppSettings::WaitOnError))
+ .set_color(cmd.get_color())
+ .set_help_flag(get_help_flag(cmd))
+ }
+
+ pub(crate) fn set_message(mut self, message: impl Into<Message>) -> Self {
+ self.inner.message = Some(message.into());
+ self
+ }
+
+ pub(crate) fn set_info(mut self, info: Vec<String>) -> Self {
+ self.info = info;
+ self
+ }
+
+ pub(crate) fn set_source(mut self, source: Box<dyn error::Error + Send + Sync>) -> Self {
+ self.inner.source = Some(source);
+ self
+ }
+
+ pub(crate) fn set_color(mut self, color_when: ColorChoice) -> Self {
+ self.inner.color_when = color_when;
+ self
+ }
+
+ pub(crate) fn set_help_flag(mut self, help_flag: Option<&'static str>) -> Self {
+ self.inner.help_flag = help_flag;
+ self
+ }
+
+ pub(crate) fn set_wait_on_exit(mut self, yes: bool) -> Self {
+ self.inner.wait_on_exit = yes;
+ self
+ }
+
+ /// Does not verify if `ContextKind` is already present
+ #[inline(never)]
+ pub(crate) fn insert_context_unchecked(
+ mut self,
+ kind: ContextKind,
+ value: ContextValue,
+ ) -> Self {
+ self.inner.context.push((kind, value));
+ self
+ }
+
+ /// Does not verify if `ContextKind` is already present
+ #[inline(never)]
+ pub(crate) fn extend_context_unchecked<const N: usize>(
+ mut self,
+ context: [(ContextKind, ContextValue); N],
+ ) -> Self {
+ self.inner.context.extend(context);
+ self
+ }
+
+ #[inline(never)]
+ fn get_context(&self, kind: ContextKind) -> Option<&ContextValue> {
+ self.inner
+ .context
+ .iter()
+ .find_map(|(k, v)| (*k == kind).then(|| v))
+ }
+
+ pub(crate) fn display_help(cmd: &Command, colorizer: Colorizer) -> Self {
+ Self::for_app(ErrorKind::DisplayHelp, cmd, colorizer, vec![])
+ }
+
+ pub(crate) fn display_help_error(cmd: &Command, colorizer: Colorizer) -> Self {
+ Self::for_app(
+ ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand,
+ cmd,
+ colorizer,
+ vec![],
+ )
+ }
+
+ pub(crate) fn display_version(cmd: &Command, colorizer: Colorizer) -> Self {
+ Self::for_app(ErrorKind::DisplayVersion, cmd, colorizer, vec![])
+ }
+
+ pub(crate) fn argument_conflict(
+ cmd: &Command,
+ arg: String,
+ mut others: Vec<String>,
+ usage: String,
+ ) -> Self {
+ let info = others.clone();
+ let others = match others.len() {
+ 0 => ContextValue::None,
+ 1 => ContextValue::String(others.pop().unwrap()),
+ _ => ContextValue::Strings(others),
+ };
+ Self::new(ErrorKind::ArgumentConflict)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::PriorArg, others),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn empty_value(cmd: &Command, good_vals: &[&str], arg: String) -> Self {
+ let info = vec![arg.clone()];
+ let mut err = Self::new(ErrorKind::EmptyValue)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([(ContextKind::InvalidArg, ContextValue::String(arg))]);
+ if !good_vals.is_empty() {
+ err = err.insert_context_unchecked(
+ ContextKind::ValidValue,
+ ContextValue::Strings(good_vals.iter().map(|s| (*s).to_owned()).collect()),
+ );
+ }
+ err
+ }
+
+ pub(crate) fn no_equals(cmd: &Command, arg: String, usage: String) -> Self {
+ let info = vec![arg.clone()];
+ Self::new(ErrorKind::NoEquals)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn invalid_value(
+ cmd: &Command,
+ bad_val: String,
+ good_vals: &[&str],
+ arg: String,
+ ) -> Self {
+ let mut info = vec![arg.clone(), bad_val.clone()];
+ info.extend(good_vals.iter().map(|s| (*s).to_owned()));
+
+ let suggestion = suggestions::did_you_mean(&bad_val, good_vals.iter()).pop();
+ let mut err = Self::new(ErrorKind::InvalidValue)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::InvalidValue, ContextValue::String(bad_val)),
+ (
+ ContextKind::ValidValue,
+ ContextValue::Strings(good_vals.iter().map(|s| (*s).to_owned()).collect()),
+ ),
+ ]);
+ if let Some(suggestion) = suggestion {
+ err = err.insert_context_unchecked(
+ ContextKind::SuggestedValue,
+ ContextValue::String(suggestion),
+ );
+ }
+ err
+ }
+
+ pub(crate) fn invalid_subcommand(
+ cmd: &Command,
+ subcmd: String,
+ did_you_mean: String,
+ name: String,
+ usage: String,
+ ) -> Self {
+ let info = vec![subcmd.clone()];
+ let suggestion = format!("{} -- {}", name, subcmd);
+ Self::new(ErrorKind::InvalidSubcommand)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidSubcommand, ContextValue::String(subcmd)),
+ (
+ ContextKind::SuggestedSubcommand,
+ ContextValue::String(did_you_mean),
+ ),
+ (
+ ContextKind::SuggestedCommand,
+ ContextValue::String(suggestion),
+ ),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn unrecognized_subcommand(cmd: &Command, subcmd: String, usage: String) -> Self {
+ let info = vec![subcmd.clone()];
+ Self::new(ErrorKind::UnrecognizedSubcommand)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidSubcommand, ContextValue::String(subcmd)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn missing_required_argument(
+ cmd: &Command,
+ required: Vec<String>,
+ usage: String,
+ ) -> Self {
+ let info = required.clone();
+ Self::new(ErrorKind::MissingRequiredArgument)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::Strings(required)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn missing_subcommand(cmd: &Command, name: String, usage: String) -> Self {
+ let info = vec![];
+ Self::new(ErrorKind::MissingSubcommand)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidSubcommand, ContextValue::String(name)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn invalid_utf8(cmd: &Command, usage: String) -> Self {
+ let info = vec![];
+ Self::new(ErrorKind::InvalidUtf8)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([(ContextKind::Usage, ContextValue::String(usage))])
+ }
+
+ pub(crate) fn too_many_occurrences(
+ cmd: &Command,
+ arg: String,
+ max_occurs: usize,
+ curr_occurs: usize,
+ usage: String,
+ ) -> Self {
+ let info = vec![arg.clone(), curr_occurs.to_string(), max_occurs.to_string()];
+ Self::new(ErrorKind::TooManyOccurrences)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (
+ ContextKind::MaxOccurrences,
+ ContextValue::Number(max_occurs as isize),
+ ),
+ (
+ ContextKind::ActualNumValues,
+ ContextValue::Number(curr_occurs as isize),
+ ),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn too_many_values(cmd: &Command, val: String, arg: String, usage: String) -> Self {
+ let info = vec![arg.clone(), val.clone()];
+ Self::new(ErrorKind::TooManyValues)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::InvalidValue, ContextValue::String(val)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn too_few_values(
+ cmd: &Command,
+ arg: String,
+ min_vals: usize,
+ curr_vals: usize,
+ usage: String,
+ ) -> Self {
+ let info = vec![arg.clone(), curr_vals.to_string(), min_vals.to_string()];
+ Self::new(ErrorKind::TooFewValues)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (
+ ContextKind::MinValues,
+ ContextValue::Number(min_vals as isize),
+ ),
+ (
+ ContextKind::ActualNumValues,
+ ContextValue::Number(curr_vals as isize),
+ ),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn value_validation(
+ arg: String,
+ val: String,
+ err: Box<dyn error::Error + Send + Sync>,
+ ) -> Self {
+ let info = vec![arg.clone(), val.to_string(), err.to_string()];
+ Self::new(ErrorKind::ValueValidation)
+ .set_info(info)
+ .set_source(err)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::InvalidValue, ContextValue::String(val)),
+ ])
+ }
+
+ pub(crate) fn wrong_number_of_values(
+ cmd: &Command,
+ arg: String,
+ num_vals: usize,
+ curr_vals: usize,
+ usage: String,
+ ) -> Self {
+ let info = vec![arg.clone(), curr_vals.to_string(), num_vals.to_string()];
+ Self::new(ErrorKind::WrongNumberOfValues)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (
+ ContextKind::ExpectedNumValues,
+ ContextValue::Number(num_vals as isize),
+ ),
+ (
+ ContextKind::ActualNumValues,
+ ContextValue::Number(curr_vals as isize),
+ ),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn unexpected_multiple_usage(cmd: &Command, arg: String, usage: String) -> Self {
+ let info = vec![arg.clone()];
+ Self::new(ErrorKind::UnexpectedMultipleUsage)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn unknown_argument(
+ cmd: &Command,
+ arg: String,
+ did_you_mean: Option<(String, Option<String>)>,
+ usage: String,
+ ) -> Self {
+ let info = vec![arg.clone()];
+ let mut err = Self::new(ErrorKind::UnknownArgument)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ]);
+ if let Some((flag, sub)) = did_you_mean {
+ err = err.insert_context_unchecked(
+ ContextKind::SuggestedArg,
+ ContextValue::String(format!("--{}", flag)),
+ );
+ if let Some(sub) = sub {
+ err = err.insert_context_unchecked(
+ ContextKind::SuggestedSubcommand,
+ ContextValue::String(sub),
+ );
+ }
+ }
+ err
+ }
+
+ pub(crate) fn unnecessary_double_dash(cmd: &Command, arg: String, usage: String) -> Self {
+ let info = vec![arg.clone()];
+ Self::new(ErrorKind::UnknownArgument)
+ .with_cmd(cmd)
+ .set_info(info)
+ .extend_context_unchecked([
+ (ContextKind::InvalidArg, ContextValue::String(arg)),
+ (ContextKind::TrailingArg, ContextValue::Bool(true)),
+ (ContextKind::Usage, ContextValue::String(usage)),
+ ])
+ }
+
+ pub(crate) fn argument_not_found_auto(arg: String) -> Self {
+ let info = vec![arg.clone()];
+ Self::new(ErrorKind::ArgumentNotFound)
+ .set_info(info)
+ .extend_context_unchecked([(ContextKind::InvalidArg, ContextValue::String(arg))])
+ }
+
+ fn formatted(&self) -> Cow<'_, Colorizer> {
+ if let Some(message) = self.inner.message.as_ref() {
+ message.formatted()
+ } else {
+ let mut c = Colorizer::new(self.stream(), self.inner.color_when);
+
+ start_error(&mut c);
+
+ if !self.write_dynamic_context(&mut c) {
+ if let Some(msg) = self.kind().as_str() {
+ c.none(msg.to_owned());
+ } else if let Some(source) = self.inner.source.as_ref() {
+ c.none(source.to_string());
+ } else {
+ c.none("Unknown cause");
+ }
+ }
+
+ let usage = self.get_context(ContextKind::Usage);
+ if let Some(ContextValue::String(usage)) = usage {
+ put_usage(&mut c, usage);
+ }
+
+ try_help(&mut c, self.inner.help_flag);
+
+ Cow::Owned(c)
+ }
+ }
+
+ #[must_use]
+ fn write_dynamic_context(&self, c: &mut Colorizer) -> bool {
+ match self.kind() {
+ ErrorKind::ArgumentConflict => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let prior_arg = self.get_context(ContextKind::PriorArg);
+ if let (Some(ContextValue::String(invalid_arg)), Some(prior_arg)) =
+ (invalid_arg, prior_arg)
+ {
+ c.none("The argument '");
+ c.warning(invalid_arg);
+ c.none("' cannot be used with");
+
+ match prior_arg {
+ ContextValue::Strings(values) => {
+ c.none(":");
+ for v in values {
+ c.none("\n ");
+ c.warning(&**v);
+ }
+ }
+ ContextValue::String(value) => {
+ c.none(" '");
+ c.warning(value);
+ c.none("'");
+ }
+ _ => {
+ c.none(" one or more of the other specified arguments");
+ }
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::EmptyValue => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
+ c.none("The argument '");
+ c.warning(invalid_arg);
+ c.none("' requires a value but none was supplied");
+
+ let possible_values = self.get_context(ContextKind::ValidValue);
+ if let Some(ContextValue::Strings(possible_values)) = possible_values {
+ c.none("\n\t[possible values: ");
+ if let Some((last, elements)) = possible_values.split_last() {
+ for v in elements {
+ c.good(escape(v));
+ c.none(", ");
+ }
+ c.good(escape(last));
+ }
+ c.none("]");
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::NoEquals => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
+ c.none("Equal sign is needed when assigning values to '");
+ c.warning(invalid_arg);
+ c.none("'.");
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::InvalidValue => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let invalid_value = self.get_context(ContextKind::InvalidValue);
+ if let (
+ Some(ContextValue::String(invalid_arg)),
+ Some(ContextValue::String(invalid_value)),
+ ) = (invalid_arg, invalid_value)
+ {
+ c.none(quote(invalid_value));
+ c.none(" isn't a valid value for '");
+ c.warning(invalid_arg);
+ c.none("'");
+
+ let possible_values = self.get_context(ContextKind::ValidValue);
+ if let Some(ContextValue::Strings(possible_values)) = possible_values {
+ c.none("\n\t[possible values: ");
+ if let Some((last, elements)) = possible_values.split_last() {
+ for v in elements {
+ c.good(escape(v));
+ c.none(", ");
+ }
+ c.good(escape(last));
+ }
+ c.none("]");
+ }
+
+ let suggestion = self.get_context(ContextKind::SuggestedValue);
+ if let Some(ContextValue::String(suggestion)) = suggestion {
+ c.none("\n\n\tDid you mean ");
+ c.good(quote(suggestion));
+ c.none("?");
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::InvalidSubcommand => {
+ let invalid_sub = self.get_context(ContextKind::InvalidSubcommand);
+ if let Some(ContextValue::String(invalid_sub)) = invalid_sub {
+ c.none("The subcommand '");
+ c.warning(invalid_sub);
+ c.none("' wasn't recognized");
+
+ let valid_sub = self.get_context(ContextKind::SuggestedSubcommand);
+ if let Some(ContextValue::String(valid_sub)) = valid_sub {
+ c.none("\n\n\tDid you mean ");
+ c.good(valid_sub);
+ c.none("?");
+ }
+
+ let suggestion = self.get_context(ContextKind::SuggestedCommand);
+ if let Some(ContextValue::String(suggestion)) = suggestion {
+ c.none(
+ "\n\nIf you believe you received this message in error, try re-running with '",
+ );
+ c.good(suggestion);
+ c.none("'");
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::UnrecognizedSubcommand => {
+ let invalid_sub = self.get_context(ContextKind::InvalidSubcommand);
+ if let Some(ContextValue::String(invalid_sub)) = invalid_sub {
+ c.none("The subcommand '");
+ c.warning(invalid_sub);
+ c.none("' wasn't recognized");
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::MissingRequiredArgument => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::Strings(invalid_arg)) = invalid_arg {
+ c.none("The following required arguments were not provided:");
+ for v in invalid_arg {
+ c.none("\n ");
+ c.good(&**v);
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::MissingSubcommand => {
+ let invalid_sub = self.get_context(ContextKind::InvalidSubcommand);
+ if let Some(ContextValue::String(invalid_sub)) = invalid_sub {
+ c.none("'");
+ c.warning(invalid_sub);
+ c.none("' requires a subcommand but one was not provided");
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::InvalidUtf8 => false,
+ ErrorKind::TooManyOccurrences => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let actual_num_occurs = self.get_context(ContextKind::ActualNumOccurrences);
+ let max_occurs = self.get_context(ContextKind::MaxOccurrences);
+ if let (
+ Some(ContextValue::String(invalid_arg)),
+ Some(ContextValue::Number(actual_num_occurs)),
+ Some(ContextValue::Number(max_occurs)),
+ ) = (invalid_arg, actual_num_occurs, max_occurs)
+ {
+ let were_provided = Error::singular_or_plural(*actual_num_occurs as usize);
+ c.none("The argument '");
+ c.warning(invalid_arg);
+ c.none("' allows at most ");
+ c.warning(max_occurs.to_string());
+ c.none(" occurrences but ");
+ c.warning(actual_num_occurs.to_string());
+ c.none(were_provided);
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::TooManyValues => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let invalid_value = self.get_context(ContextKind::InvalidValue);
+ if let (
+ Some(ContextValue::String(invalid_arg)),
+ Some(ContextValue::String(invalid_value)),
+ ) = (invalid_arg, invalid_value)
+ {
+ c.none("The value '");
+ c.warning(invalid_value);
+ c.none("' was provided to '");
+ c.warning(invalid_arg);
+ c.none("' but it wasn't expecting any more values");
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::TooFewValues => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let actual_num_values = self.get_context(ContextKind::ActualNumValues);
+ let min_values = self.get_context(ContextKind::MinValues);
+ if let (
+ Some(ContextValue::String(invalid_arg)),
+ Some(ContextValue::Number(actual_num_values)),
+ Some(ContextValue::Number(min_values)),
+ ) = (invalid_arg, actual_num_values, min_values)
+ {
+ let were_provided = Error::singular_or_plural(*actual_num_values as usize);
+ c.none("The argument '");
+ c.warning(invalid_arg);
+ c.none("' requires at least ");
+ c.warning(min_values.to_string());
+ c.none(" values but only ");
+ c.warning(actual_num_values.to_string());
+ c.none(were_provided);
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::ValueValidation => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let invalid_value = self.get_context(ContextKind::InvalidValue);
+ if let (
+ Some(ContextValue::String(invalid_arg)),
+ Some(ContextValue::String(invalid_value)),
+ ) = (invalid_arg, invalid_value)
+ {
+ c.none("Invalid value ");
+ c.warning(quote(invalid_value));
+ c.none(" for '");
+ c.warning(invalid_arg);
+ if let Some(source) = self.inner.source.as_deref() {
+ c.none("': ");
+ c.none(source.to_string());
+ } else {
+ c.none("'");
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::WrongNumberOfValues => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ let actual_num_values = self.get_context(ContextKind::ActualNumValues);
+ let num_values = self.get_context(ContextKind::ExpectedNumValues);
+ if let (
+ Some(ContextValue::String(invalid_arg)),
+ Some(ContextValue::Number(actual_num_values)),
+ Some(ContextValue::Number(num_values)),
+ ) = (invalid_arg, actual_num_values, num_values)
+ {
+ let were_provided = Error::singular_or_plural(*actual_num_values as usize);
+ c.none("The argument '");
+ c.warning(invalid_arg);
+ c.none("' requires ");
+ c.warning(num_values.to_string());
+ c.none(" values, but ");
+ c.warning(actual_num_values.to_string());
+ c.none(were_provided);
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::UnexpectedMultipleUsage => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
+ c.none("The argument '");
+ c.warning(invalid_arg.to_string());
+ c.none("' was provided more than once, but cannot be used multiple times");
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::UnknownArgument => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
+ c.none("Found argument '");
+ c.warning(invalid_arg.to_string());
+ c.none("' which wasn't expected, or isn't valid in this context");
+
+ let valid_sub = self.get_context(ContextKind::SuggestedSubcommand);
+ let valid_arg = self.get_context(ContextKind::SuggestedArg);
+ match (valid_sub, valid_arg) {
+ (
+ Some(ContextValue::String(valid_sub)),
+ Some(ContextValue::String(valid_arg)),
+ ) => {
+ c.none("\n\n\tDid you mean ");
+ c.none("to put '");
+ c.good(valid_arg);
+ c.none("' after the subcommand '");
+ c.good(valid_sub);
+ c.none("'?");
+ }
+ (None, Some(ContextValue::String(valid_arg))) => {
+ c.none("\n\n\tDid you mean '");
+ c.good(valid_arg);
+ c.none("'?");
+ }
+ (_, _) => {}
+ }
+
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
+ if invalid_arg.starts_with('-') {
+ c.none(format!(
+ "\n\n\tIf you tried to supply `{}` as a value rather than a flag, use `-- {}`",
+ invalid_arg, invalid_arg
+ ));
+ }
+
+ let trailing_arg = self.get_context(ContextKind::TrailingArg);
+ if trailing_arg == Some(&ContextValue::Bool(true)) {
+ c.none(format!(
+ "\n\n\tIf you tried to supply `{}` as a subcommand, remove the '--' before it.",
+ invalid_arg
+ ));
+ }
+ }
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::ArgumentNotFound => {
+ let invalid_arg = self.get_context(ContextKind::InvalidArg);
+ if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
+ c.none("The argument '");
+ c.warning(invalid_arg.to_string());
+ c.none("' wasn't found");
+ true
+ } else {
+ false
+ }
+ }
+ ErrorKind::DisplayHelp
+ | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
+ | ErrorKind::DisplayVersion
+ | ErrorKind::Io
+ | ErrorKind::Format => false,
+ }
+ }
+
+ /// Returns the singular or plural form on the verb to be based on the argument's value.
+ fn singular_or_plural(n: usize) -> &'static str {
+ if n > 1 {
+ " were provided"
+ } else {
+ " was provided"
+ }
+ }
+}
+
+impl From<io::Error> for Error {
+ fn from(e: io::Error) -> Self {
+ Error::raw(ErrorKind::Io, e)
+ }
+}
+
+impl From<fmt::Error> for Error {
+ fn from(e: fmt::Error) -> Self {
+ Error::raw(ErrorKind::Format, e)
+ }
+}
+
+impl error::Error for Error {
+ #[allow(trivial_casts)]
+ fn source(&self) -> Option<&(dyn error::Error + 'static)> {
+ self.inner.source.as_ref().map(|e| e.as_ref() as _)
+ }
+}
+
+impl Display for Error {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ // Assuming `self.message` already has a trailing newline, from `try_help` or similar
+ write!(f, "{}", self.formatted())?;
+ if let Some(backtrace) = self.inner.backtrace.as_ref() {
+ writeln!(f)?;
+ writeln!(f, "Backtrace:")?;
+ writeln!(f, "{}", backtrace)?;
+ }
+ Ok(())
+ }
+}
+
+fn start_error(c: &mut Colorizer) {
+ c.error("error:");
+ c.none(" ");
+}
+
+fn put_usage(c: &mut Colorizer, usage: impl Into<String>) {
+ c.none("\n\n");
+ c.none(usage);
+}
+
+fn get_help_flag(cmd: &Command) -> Option<&'static str> {
+ if !cmd.is_disable_help_flag_set() {
+ Some("--help")
+ } else if cmd.has_subcommands() && !cmd.is_disable_help_subcommand_set() {
+ Some("help")
+ } else {
+ None
+ }
+}
+
+fn try_help(c: &mut Colorizer, help: Option<&str>) {
+ if let Some(help) = help {
+ c.none("\n\nFor more information try ");
+ c.good(help);
+ c.none("\n");
+ } else {
+ c.none("\n");
+ }
+}
+
+fn quote(s: impl AsRef<str>) -> String {
+ let s = s.as_ref();
+ format!("{:?}", s)
+}
+
+fn escape(s: impl AsRef<str>) -> String {
+ let s = s.as_ref();
+ if s.contains(char::is_whitespace) {
+ quote(s)
+ } else {
+ s.to_owned()
+ }
+}
+
+#[derive(Clone, Debug)]
+pub(crate) enum Message {
+ Raw(String),
+ Formatted(Colorizer),
+}
+
+impl Message {
+ fn format(&mut self, cmd: &Command, usage: String) {
+ match self {
+ Message::Raw(s) => {
+ let mut c = Colorizer::new(Stream::Stderr, cmd.get_color());
+
+ let mut message = String::new();
+ std::mem::swap(s, &mut message);
+ start_error(&mut c);
+ c.none(message);
+ put_usage(&mut c, usage);
+ try_help(&mut c, get_help_flag(cmd));
+ *self = Self::Formatted(c);
+ }
+ Message::Formatted(_) => {}
+ }
+ }
+
+ fn formatted(&self) -> Cow<Colorizer> {
+ match self {
+ Message::Raw(s) => {
+ let mut c = Colorizer::new(Stream::Stderr, ColorChoice::Never);
+ start_error(&mut c);
+ c.none(s);
+ Cow::Owned(c)
+ }
+ Message::Formatted(c) => Cow::Borrowed(c),
+ }
+ }
+}
+
+impl From<String> for Message {
+ fn from(inner: String) -> Self {
+ Self::Raw(inner)
+ }
+}
+
+impl From<Colorizer> for Message {
+ fn from(inner: Colorizer) -> Self {
+ Self::Formatted(inner)
+ }
+}
+
+#[cfg(feature = "debug")]
+#[derive(Debug)]
+struct Backtrace(backtrace::Backtrace);
+
+#[cfg(feature = "debug")]
+impl Backtrace {
+ fn new() -> Option<Self> {
+ Some(Self(backtrace::Backtrace::new()))
+ }
+}
+
+#[cfg(feature = "debug")]
+impl Display for Backtrace {
+ fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ // `backtrace::Backtrace` uses `Debug` instead of `Display`
+ write!(f, "{:?}", self.0)
+ }
+}
+
+#[cfg(not(feature = "debug"))]
+#[derive(Debug)]
+struct Backtrace;
+
+#[cfg(not(feature = "debug"))]
+impl Backtrace {
+ fn new() -> Option<Self> {
+ None
+ }
+}
+
+#[cfg(not(feature = "debug"))]
+impl Display for Backtrace {
+ fn fmt(&self, _: &mut Formatter) -> fmt::Result {
+ Ok(())
+ }
+}
+
+#[test]
+fn check_auto_traits() {
+ static_assertions::assert_impl_all!(Error: Send, Sync, Unpin);
+}
diff --git a/vendor/clap-3.2.20/src/lib.rs b/vendor/clap-3.2.20/src/lib.rs
new file mode 100644
index 000000000..5cefe6ec1
--- /dev/null
+++ b/vendor/clap-3.2.20/src/lib.rs
@@ -0,0 +1,232 @@
+// Copyright â“’ 2015-2016 Kevin B. Knapp and [`clap-rs` contributors](https://github.com/clap-rs/clap/graphs/contributors).
+// Licensed under the MIT license
+// (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such
+// notice may not be copied, modified, or distributed except according to those terms.
+
+//! > **Command Line Argument Parser for Rust**
+//!
+//! Quick Links:
+//! - Derive [tutorial][_derive::_tutorial] and [reference][_derive]
+//! - Builder [tutorial][_tutorial] and [reference](index.html)
+//! - [Cookbook][_cookbook]
+//! - [FAQ][_faq]
+//! - [Discussions](https://github.com/clap-rs/clap/discussions)
+//!
+//! ## Aspirations
+//!
+//! - Out of the box, users get a polished CLI experience
+//! - Including common argument behavior, help generation, suggested fixes for users, colored output, [shell completions](https://github.com/clap-rs/clap/tree/master/clap_complete), etc
+//! - Flexible enough to port your existing CLI interface
+//! - However, we won't necessarily streamline support for each use case
+//! - Reasonable parse performance
+//! - Resilient maintainership, including
+//! - Willing to break compatibility rather than batching up breaking changes in large releases
+//! - Leverage feature flags to keep to one active branch
+//! - Being under [WG-CLI](https://github.com/rust-cli/team/) to increase the bus factor
+//! - We follow semver and will wait about 6-9 months between major breaking changes
+//! - We will support the last two minor Rust releases (MSRV, currently 1.56.1)
+//!
+//! While these aspirations can be at odds with fast build times and low binary
+//! size, we will still strive to keep these reasonable for the flexibility you
+//! get. Check out the
+//! [argparse-benchmarks](https://github.com/rust-cli/argparse-benchmarks-rs) for
+//! CLI parsers optimized for other use cases.
+//!
+//! ## Example
+//!
+//! Run
+//! ```console
+//! $ cargo add clap --features derive
+//! ```
+//! *(See also [feature flag reference][_features])*
+//!
+//! Then define your CLI in `main.rs`:
+#![cfg_attr(not(feature = "derive"), doc = " ```ignore")]
+#![cfg_attr(feature = "derive", doc = " ```no_run")]
+#![doc = include_str!("../examples/demo.rs")]
+//! ```
+//!
+//! And try it out:
+#![doc = include_str!("../examples/demo.md")]
+//!
+//! See also the derive [tutorial][_derive::_tutorial] and [reference][_derive]
+//!
+//! ### Related Projects
+//!
+//! Augment clap:
+//! - [wild](https://crates.io/crates/wild) for supporting wildcards (`*`) on Windows like you do Linux
+//! - [argfile](https://crates.io/crates/argfile) for loading additional arguments from a file (aka response files)
+//! - [shadow-rs](https://crates.io/crates/shadow-rs) for generating `Command::long_version`
+//! - [clap_mangen](https://crates.io/crates/clap_mangen) for generating man page source (roff)
+//! - [clap_complete](https://crates.io/crates/clap_complete) for shell completion support
+//!
+//! CLI Helpers
+//! - [clap-verbosity-flag](https://crates.io/crates/clap-verbosity-flag)
+//! - [clap-cargo](https://crates.io/crates/clap-cargo)
+//! - [concolor-clap](https://crates.io/crates/concolor-clap)
+//!
+//! Testing
+//! - [`trycmd`](https://crates.io/crates/trycmd): Bulk snapshot testing
+//! - [`snapbox`](https://crates.io/crates/snapbox): Specialized snapshot testing
+//! - [`assert_cmd`](https://crates.io/crates/assert_cmd) and [`assert_fs`](https://crates.io/crates/assert_fs): Customized testing
+//!
+//! Documentation:
+//! - [Command-line Apps for Rust](https://rust-cli.github.io/book/index.html) book
+//!
+
+#![cfg_attr(docsrs, feature(doc_auto_cfg))]
+#![doc(html_logo_url = "https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png")]
+#![warn(
+ missing_docs,
+ missing_debug_implementations,
+ missing_copy_implementations,
+ trivial_casts,
+ unused_allocation,
+ trivial_numeric_casts,
+ clippy::single_char_pattern
+)]
+#![forbid(unsafe_code)]
+// HACK https://github.com/rust-lang/rust-clippy/issues/7290
+#![allow(clippy::single_component_path_imports)]
+#![allow(clippy::branches_sharing_code)]
+// Doesn't allow for debug statements, etc to be unique
+#![allow(clippy::if_same_then_else)]
+
+#[cfg(not(feature = "std"))]
+compile_error!("`std` feature is currently required to build `clap`");
+
+pub use crate::builder::ArgAction;
+pub use crate::builder::Command;
+pub use crate::builder::{Arg, ArgGroup};
+pub use crate::error::Error;
+pub use crate::parser::ArgMatches;
+#[cfg(feature = "color")]
+pub use crate::util::color::ColorChoice;
+#[cfg(not(feature = "color"))]
+#[allow(unused_imports)]
+pub(crate) use crate::util::color::ColorChoice;
+
+pub use crate::derive::{Args, CommandFactory, FromArgMatches, Parser, Subcommand, ValueEnum};
+
+#[allow(deprecated)]
+pub use crate::builder::App;
+pub use crate::builder::{AppFlags, AppSettings, ArgFlags, ArgSettings, PossibleValue, ValueHint};
+pub use crate::error::{ErrorKind, Result};
+#[allow(deprecated)]
+pub use crate::parser::{Indices, OsValues, ValueSource, Values};
+
+#[cfg(feature = "yaml")]
+#[doc(hidden)]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(
+ since = "3.0.0",
+ note = "Deprecated in Issue #3087, maybe clap::Parser would fit your use case?"
+ )
+)]
+#[doc(hidden)]
+pub use yaml_rust::YamlLoader;
+
+#[cfg(feature = "derive")]
+#[doc(hidden)]
+pub use clap_derive::{self, *};
+
+/// Deprecated, replaced with [`CommandFactory`]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `CommandFactory`")
+)]
+pub use CommandFactory as IntoApp;
+/// Deprecated, replaced with [`Parser`]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `Parser`")
+)]
+#[doc(hidden)]
+pub use Parser as StructOpt;
+/// Deprecated, replaced with [`ValueEnum`]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.2.0", note = "Replaced with `ValueEnum`")
+)]
+pub use ValueEnum as ArgEnum;
+
+#[cfg(feature = "unstable-doc")]
+pub mod _cookbook;
+#[cfg(feature = "unstable-doc")]
+pub mod _derive;
+#[cfg(feature = "unstable-doc")]
+pub mod _faq;
+#[cfg(feature = "unstable-doc")]
+pub mod _features;
+#[cfg(feature = "unstable-doc")]
+pub mod _tutorial;
+
+#[doc(hidden)]
+pub mod __macro_refs {
+ #[cfg(any(feature = "derive", feature = "cargo"))]
+ #[doc(hidden)]
+ pub use once_cell;
+}
+
+#[macro_use]
+#[allow(missing_docs)]
+mod macros;
+
+mod derive;
+
+#[cfg(feature = "regex")]
+pub use crate::builder::RegexRef;
+
+pub mod builder;
+pub mod error;
+pub mod parser;
+
+mod mkeymap;
+mod output;
+mod util;
+
+const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \
+ report at https://github.com/clap-rs/clap/issues";
+const INVALID_UTF8: &str = "unexpected invalid UTF-8 code point";
+
+/// Deprecated, replaced with [`Command::new`], unless you were looking for [Subcommand]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(
+ since = "3.0.0",
+ note = "Replaced with `Command::new` unless you intended the `Subcommand` trait"
+ )
+)]
+#[doc(hidden)]
+#[derive(Debug, Copy, Clone)]
+pub struct SubCommand {}
+
+#[allow(deprecated)]
+impl SubCommand {
+ /// Deprecated, replaced with [`Command::new`].
+ /// Did you mean Subcommand (lower-case c)?
+ #[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `Command::new`")
+ )]
+ #[doc(hidden)]
+ pub fn with_name<'help>(name: &str) -> App<'help> {
+ Command::new(name)
+ }
+
+ /// Deprecated in [Issue #3087](https://github.com/clap-rs/clap/issues/3087), maybe [`clap::Parser`][crate::Parser] would fit your use case?
+ #[cfg(feature = "yaml")]
+ #[cfg_attr(
+ feature = "deprecated",
+ deprecated(
+ since = "3.0.0",
+ note = "Deprecated in Issue #3087, maybe clap::Parser would fit your use case?"
+ )
+ )]
+ #[doc(hidden)]
+ pub fn from_yaml(yaml: &yaml_rust::Yaml) -> App {
+ #![allow(deprecated)]
+ Command::from_yaml(yaml)
+ }
+}
diff --git a/vendor/clap-3.2.20/src/macros.rs b/vendor/clap-3.2.20/src/macros.rs
new file mode 100644
index 000000000..1f9167408
--- /dev/null
+++ b/vendor/clap-3.2.20/src/macros.rs
@@ -0,0 +1,1058 @@
+/// Deprecated in [Issue #3087](https://github.com/clap-rs/clap/issues/3087), maybe [`clap::Parser`][crate::Parser] would fit your use case?
+#[cfg(feature = "yaml")]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(
+ since = "3.0.0",
+ note = "Deprecated in Issue #3087, maybe clap::Parser would fit your use case?"
+ )
+)]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! load_yaml {
+ ($yaml:expr) => {
+ &$crate::YamlLoader::load_from_str(include_str!($yaml)).expect("failed to load YAML file")
+ [0]
+ };
+}
+
+/// Deprecated, replaced with [`ArgMatches::value_of_t`][crate::ArgMatches::value_of_t]
+#[macro_export]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `ArgMatches::get_one`")
+)]
+#[doc(hidden)]
+macro_rules! value_t {
+ ($m:ident, $v:expr, $t:ty) => {
+ $crate::value_t!($m.value_of($v), $t)
+ };
+ ($m:ident.value_of($v:expr), $t:ty) => {
+ $m.value_of_t::<$t>($v)
+ };
+}
+
+/// Deprecated, replaced with [`ArgMatches::value_of_t_or_exit`][crate::ArgMatches::value_of_t_or_exit]
+#[macro_export]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `ArgMatches::get_one`")
+)]
+#[doc(hidden)]
+macro_rules! value_t_or_exit {
+ ($m:ident, $v:expr, $t:ty) => {
+ value_t_or_exit!($m.value_of($v), $t)
+ };
+ ($m:ident.value_of($v:expr), $t:ty) => {
+ $m.value_of_t_or_exit::<$t>($v)
+ };
+}
+
+/// Deprecated, replaced with [`ArgMatches::values_of_t`][crate::ArgMatches::value_of_t]
+#[macro_export]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `ArgMatches::get_many`")
+)]
+#[doc(hidden)]
+macro_rules! values_t {
+ ($m:ident, $v:expr, $t:ty) => {
+ values_t!($m.values_of($v), $t)
+ };
+ ($m:ident.values_of($v:expr), $t:ty) => {
+ $m.values_of_t::<$t>($v)
+ };
+}
+
+/// Deprecated, replaced with [`ArgMatches::values_of_t_or_exit`][crate::ArgMatches::value_of_t_or_exit]
+#[macro_export]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `ArgMatches::get_many`")
+)]
+#[doc(hidden)]
+macro_rules! values_t_or_exit {
+ ($m:ident, $v:expr, $t:ty) => {
+ values_t_or_exit!($m.values_of($v), $t)
+ };
+ ($m:ident.values_of($v:expr), $t:ty) => {
+ $m.values_of_t_or_exit::<$t>($v)
+ };
+}
+
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `ValueEnum`")
+)]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _clap_count_exprs {
+ () => { 0 };
+ ($e:expr) => { 1 };
+ ($e:expr, $($es:expr),+) => { 1 + $crate::_clap_count_exprs!($($es),*) };
+}
+
+/// Deprecated, replaced with [`ArgEnum`][crate::ArgEnum]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.0.0", note = "Replaced with `ValueEnum`")
+)]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! arg_enum {
+ (@as_item $($i:item)*) => ($($i)*);
+ (@impls ( $($tts:tt)* ) -> ($e:ident, $($v:ident),+)) => {
+ $crate::arg_enum!(@as_item
+ $($tts)*
+
+ impl ::std::str::FromStr for $e {
+ type Err = String;
+
+ fn from_str(s: &str) -> ::std::result::Result<Self,Self::Err> {
+ #[allow(deprecated, unused_imports)]
+ use ::std::ascii::AsciiExt;
+ match s {
+ $(stringify!($v) |
+ _ if s.eq_ignore_ascii_case(stringify!($v)) => Ok($e::$v)),+,
+ _ => Err({
+ let v = vec![
+ $(stringify!($v),)+
+ ];
+ format!("valid values: {}",
+ v.join(", "))
+ }),
+ }
+ }
+ }
+ impl ::std::fmt::Display for $e {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+ match *self {
+ $($e::$v => write!(f, stringify!($v)),)+
+ }
+ }
+ }
+ impl $e {
+ #[allow(dead_code)]
+ pub fn variants() -> [&'static str; $crate::_clap_count_exprs!($(stringify!($v)),+)] {
+ [
+ $(stringify!($v),)+
+ ]
+ }
+ });
+ };
+ ($(#[$($m:meta),+])+ pub enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
+ $crate::arg_enum!(@impls
+ ($(#[$($m),+])+
+ pub enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ ($(#[$($m:meta),+])+ pub enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
+ $crate::arg_enum!(@impls
+ ($(#[$($m),+])+
+ pub enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ ($(#[$($m:meta),+])+ enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
+ $crate::arg_enum!(@impls
+ ($(#[$($m),+])+
+ enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ ($(#[$($m:meta),+])+ enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
+ $crate::arg_enum!(@impls
+ ($(#[$($m),+])+
+ enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ (pub enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
+ $crate::arg_enum!(@impls
+ (pub enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ (pub enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
+ $crate::arg_enum!(@impls
+ (pub enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ (enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
+ $crate::arg_enum!(@impls
+ (enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+ (enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
+ $crate::arg_enum!(@impls
+ (enum $e {
+ $($v$(=$val)*),+
+ }) -> ($e, $($v),+)
+ );
+ };
+}
+
+/// Allows you to pull the version from your Cargo.toml at compile time as
+/// `MAJOR.MINOR.PATCH_PKGVERSION_PRE`
+///
+/// # Examples
+///
+/// ```no_run
+/// # #[macro_use]
+/// # extern crate clap;
+/// # use clap::Command;
+/// # fn main() {
+/// let m = Command::new("cmd")
+/// .version(crate_version!())
+/// .get_matches();
+/// # }
+/// ```
+#[cfg(feature = "cargo")]
+#[macro_export]
+macro_rules! crate_version {
+ () => {
+ env!("CARGO_PKG_VERSION")
+ };
+}
+
+/// Allows you to pull the authors for the command from your Cargo.toml at
+/// compile time in the form:
+/// `"author1 lastname <author1@example.com>:author2 lastname <author2@example.com>"`
+///
+/// You can replace the colons with a custom separator by supplying a
+/// replacement string, so, for example,
+/// `crate_authors!(",\n")` would become
+/// `"author1 lastname <author1@example.com>,\nauthor2 lastname <author2@example.com>,\nauthor3 lastname <author3@example.com>"`
+///
+/// # Examples
+///
+/// ```no_run
+/// # #[macro_use]
+/// # extern crate clap;
+/// # use clap::Command;
+/// # fn main() {
+/// let m = Command::new("cmd")
+/// .author(crate_authors!("\n"))
+/// .get_matches();
+/// # }
+/// ```
+#[cfg(feature = "cargo")]
+#[macro_export]
+macro_rules! crate_authors {
+ ($sep:expr) => {{
+ static CACHED: clap::__macro_refs::once_cell::sync::Lazy<String> =
+ clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ env!("CARGO_PKG_AUTHORS").replace(':', $sep)
+ });
+
+ let s: &'static str = &*CACHED;
+ s
+ }};
+ () => {
+ env!("CARGO_PKG_AUTHORS")
+ };
+}
+
+/// Allows you to pull the description from your Cargo.toml at compile time.
+///
+/// # Examples
+///
+/// ```no_run
+/// # #[macro_use]
+/// # extern crate clap;
+/// # use clap::Command;
+/// # fn main() {
+/// let m = Command::new("cmd")
+/// .about(crate_description!())
+/// .get_matches();
+/// # }
+/// ```
+#[cfg(feature = "cargo")]
+#[macro_export]
+macro_rules! crate_description {
+ () => {
+ env!("CARGO_PKG_DESCRIPTION")
+ };
+}
+
+/// Allows you to pull the name from your Cargo.toml at compile time.
+///
+/// # Examples
+///
+/// ```no_run
+/// # #[macro_use]
+/// # extern crate clap;
+/// # use clap::Command;
+/// # fn main() {
+/// let m = Command::new(crate_name!())
+/// .get_matches();
+/// # }
+/// ```
+#[cfg(feature = "cargo")]
+#[macro_export]
+macro_rules! crate_name {
+ () => {
+ env!("CARGO_PKG_NAME")
+ };
+}
+
+/// Allows you to build the `Command` instance from your Cargo.toml at compile time.
+///
+/// **NOTE:** Changing the values in your `Cargo.toml` does not trigger a re-build automatically,
+/// and therefore won't change the generated output until you recompile.
+///
+/// In some cases you can "trick" the compiler into triggering a rebuild when your
+/// `Cargo.toml` is changed by including this in your `src/main.rs` file
+/// `include_str!("../Cargo.toml");`
+///
+/// # Examples
+///
+/// ```no_run
+/// # #[macro_use]
+/// # extern crate clap;
+/// # fn main() {
+/// let m = command!().get_matches();
+/// # }
+/// ```
+#[cfg(feature = "cargo")]
+#[macro_export]
+macro_rules! command {
+ () => {{
+ $crate::command!($crate::crate_name!())
+ }};
+ ($name:expr) => {{
+ let mut cmd = $crate::Command::new($name).version($crate::crate_version!());
+
+ let author = $crate::crate_authors!();
+ if !author.is_empty() {
+ cmd = cmd.author(author)
+ }
+
+ let about = $crate::crate_description!();
+ if !about.is_empty() {
+ cmd = cmd.about(about)
+ }
+
+ cmd
+ }};
+}
+
+/// Requires `cargo` feature flag to be enabled.
+#[cfg(not(feature = "cargo"))]
+#[macro_export]
+macro_rules! command {
+ () => {{
+ compile_error!("`cargo` feature flag is required");
+ }};
+ ($name:expr) => {{
+ compile_error!("`cargo` feature flag is required");
+ }};
+}
+
+/// Deprecated, replaced with [`clap::command!`][crate::command]
+#[cfg(feature = "cargo")]
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(since = "3.1.0", note = "Replaced with `clap::command!")
+)]
+#[macro_export]
+macro_rules! app_from_crate {
+ () => {{
+ let mut cmd = $crate::Command::new($crate::crate_name!()).version($crate::crate_version!());
+
+ let author = $crate::crate_authors!(", ");
+ if !author.is_empty() {
+ cmd = cmd.author(author)
+ }
+
+ let about = $crate::crate_description!();
+ if !about.is_empty() {
+ cmd = cmd.about(about)
+ }
+
+ cmd
+ }};
+ ($sep:expr) => {{
+ let mut cmd = $crate::Command::new($crate::crate_name!()).version($crate::crate_version!());
+
+ let author = $crate::crate_authors!($sep);
+ if !author.is_empty() {
+ cmd = cmd.author(author)
+ }
+
+ let about = $crate::crate_description!();
+ if !about.is_empty() {
+ cmd = cmd.about(about)
+ }
+
+ cmd
+ }};
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! arg_impl {
+ ( @string $val:ident ) => {
+ stringify!($val)
+ };
+ ( @string $val:literal ) => {{
+ let ident_or_string_literal: &str = $val;
+ ident_or_string_literal
+ }};
+ ( @string $val:tt ) => {
+ ::std::compile_error!("Only identifiers or string literals supported");
+ };
+ ( @string ) => {
+ None
+ };
+
+ ( @char $val:ident ) => {{
+ let ident_or_char_literal = stringify!($val);
+ debug_assert_eq!(
+ ident_or_char_literal.len(),
+ 1,
+ "Single-letter identifier expected, got {}",
+ ident_or_char_literal
+ );
+ ident_or_char_literal.chars().next().unwrap()
+ }};
+ ( @char $val:literal ) => {{
+ let ident_or_char_literal: char = $val;
+ ident_or_char_literal
+ }};
+ ( @char ) => {{
+ None
+ }};
+
+ (
+ @arg
+ ($arg:expr)
+ --$long:ident
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
+ }
+
+ let mut arg = $arg;
+ let long = $crate::arg_impl! { @string $long };
+ if arg.get_id().is_empty() {
+ arg = arg.id(long);
+ }
+ arg.long(long)
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ --$long:literal
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
+ }
+
+ let mut arg = $arg;
+ let long = $crate::arg_impl! { @string $long };
+ if arg.get_id().is_empty() {
+ arg = arg.id(long);
+ }
+ arg.long(long)
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ -$short:ident
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ debug_assert_eq!($arg.get_long(), None, "Short flags should precede long flags");
+ debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
+ }
+
+ $arg.short($crate::arg_impl! { @char $short })
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ -$short:literal
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ debug_assert_eq!($arg.get_long(), None, "Short flags should precede long flags");
+ debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
+ }
+
+ $arg.short($crate::arg_impl! { @char $short })
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ <$value_name:ident>
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
+ }
+ debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
+
+ let mut arg = $arg;
+
+ arg = arg.required(true);
+ arg = arg.takes_value(true);
+
+ let value_name = $crate::arg_impl! { @string $value_name };
+ if arg.get_id().is_empty() {
+ arg = arg.id(value_name);
+ }
+ arg.value_name(value_name)
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ <$value_name:literal>
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
+ }
+ debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
+
+ let mut arg = $arg;
+
+ arg = arg.required(true);
+ arg = arg.takes_value(true);
+
+ let value_name = $crate::arg_impl! { @string $value_name };
+ if arg.get_id().is_empty() {
+ arg = arg.id(value_name);
+ }
+ arg.value_name(value_name)
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ [$value_name:ident]
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
+ }
+ debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
+
+ let mut arg = $arg;
+
+ if arg.get_long().is_none() && arg.get_short().is_none() {
+ arg = arg.required(false);
+ } else {
+ arg = arg.min_values(0).max_values(1);
+ }
+ arg = arg.takes_value(true);
+
+ let value_name = $crate::arg_impl! { @string $value_name };
+ if arg.get_id().is_empty() {
+ arg = arg.id(value_name);
+ }
+ arg.value_name(value_name)
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ [$value_name:literal]
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({
+ #[allow(deprecated)]
+ {
+ debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
+ }
+ debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
+
+ let mut arg = $arg;
+
+ if arg.get_long().is_none() && arg.get_short().is_none() {
+ arg = arg.required(false);
+ } else {
+ arg = arg.min_values(0).max_values(1);
+ }
+ arg = arg.takes_value(true);
+
+ let value_name = $crate::arg_impl! { @string $value_name };
+ if arg.get_id().is_empty() {
+ arg = arg.id(value_name);
+ }
+ arg.value_name(value_name)
+ })
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ ...
+ $($tail:tt)*
+ ) => {
+ $crate::arg_impl! {
+ @arg
+ ({#[allow(deprecated)]{
+ $arg.multiple_occurrences(true)
+ }})
+ $($tail)*
+ }
+ };
+ (
+ @arg
+ ($arg:expr)
+ $help:literal
+ ) => {
+ $arg.help($help)
+ };
+ (
+ @arg
+ ($arg:expr)
+ ) => {
+ $arg
+ };
+}
+
+/// Create an [`Arg`] from a usage string.
+///
+/// Allows creation of basic settings for the [`Arg`].
+///
+/// **NOTE**: Not all settings may be set using the usage string method. Some properties are
+/// only available via the builder pattern.
+///
+/// # Syntax
+///
+/// Usage strings typically following the form:
+///
+/// ```notrust
+/// [explicit name] [short] [long] [value names] [...] [help string]
+/// ```
+///
+/// ### Explicit Name
+///
+/// The name may be either a bare-word or a string, followed by a `:`, like `name:` or
+/// `"name":`.
+///
+/// *Note:* This is an optional field, if it's omitted the argument will use one of the additional
+/// fields as the name using the following priority order:
+///
+/// 1. Explicit Name
+/// 2. Long
+/// 3. Value Name
+///
+/// See [`Arg::name`][crate::Arg::name].
+///
+/// ### Short
+///
+/// A short flag is a `-` followed by either a bare-character or quoted character, like `-f` or
+/// `-'f'`.
+///
+/// See [`Arg::short`][crate::Arg::short].
+///
+/// ### Long
+///
+/// A long flag is a `--` followed by either a bare-word or a string, like `--foo` or
+/// `--"foo"`.
+///
+/// See [`Arg::long`][crate::Arg::long].
+///
+/// ### Values (Value Notation)
+///
+/// This is set by placing bare-word between:
+/// - `[]` like `[FOO]`
+/// - Positional argument: optional
+/// - Named argument: optional value
+/// - `<>` like `<FOO>`: required
+///
+/// See [`Arg::value_name`][crate::Arg::value_name].
+///
+/// ### `...`
+///
+/// `...` (three consecutive dots/periods) specifies that this argument may occur multiple
+/// times (not to be confused with multiple values per occurrence).
+///
+/// See [`Arg::multiple_occurrences`][crate::Arg::multiple_occurrences].
+///
+/// ### Help String
+///
+/// The help string is denoted between a pair of double quotes `""` and may contain any
+/// characters.
+///
+/// # Examples
+///
+/// ```rust
+/// # use clap::{Command, Arg, arg};
+/// Command::new("prog")
+/// .args(&[
+/// arg!(--config <FILE> "a required file for the configuration and no short"),
+/// arg!(-d --debug ... "turns on debugging information and allows multiples"),
+/// arg!([input] "an optional input file to use")
+/// ])
+/// # ;
+/// ```
+/// [`Arg`]: ./struct.Arg.html
+#[macro_export]
+macro_rules! arg {
+ ( $name:ident: $($tail:tt)+ ) => {
+ $crate::arg_impl! {
+ @arg ($crate::Arg::new($crate::arg_impl! { @string $name })) $($tail)+
+ }
+ };
+ ( $($tail:tt)+ ) => {{
+ let arg = $crate::arg_impl! {
+ @arg ($crate::Arg::default()) $($tail)+
+ };
+ debug_assert!(!arg.get_id().is_empty(), "Without a value or long flag, the `name:` prefix is required");
+ arg
+ }};
+}
+
+/// Deprecated, replaced with [`clap::Parser`][crate::Parser] and [`clap::arg!`][crate::arg] (Issue clap-rs/clap#2835)
+#[cfg_attr(
+ feature = "deprecated",
+ deprecated(
+ since = "3.0.0",
+ note = "Replaced with `clap::Parser` for a declarative API (Issue clap-rs/clap#2835)"
+ )
+)]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! clap_app {
+ (@app ($builder:expr)) => { $builder };
+ (@app ($builder:expr) (@arg ($name:expr): $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($builder.arg(
+ $crate::clap_app!{ @arg ($crate::Arg::new($name)) (-) $($tail)* }))
+ $($tt)*
+ }
+ };
+ (@app ($builder:expr) (@arg $name:ident: $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($builder.arg(
+ $crate::clap_app!{ @arg ($crate::Arg::new(stringify!($name))) (-) $($tail)* }))
+ $($tt)*
+ }
+ };
+ (@app ($builder:expr) (@setting $setting:ident) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($builder.setting($crate::AppSettings::$setting))
+ $($tt)*
+ }
+ };
+// Treat the application builder as an argument to set its attributes
+ (@app ($builder:expr) (@attributes $($attr:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app ($crate::clap_app!{ @arg ($builder) $($attr)* }) $($tt)* }
+ };
+ (@app ($builder:expr) (@group $name:ident => $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($crate::clap_app!{ @group ($builder, $crate::ArgGroup::new(stringify!($name))) $($tail)* })
+ $($tt)*
+ }
+ };
+ (@app ($builder:expr) (@group $name:ident !$ident:ident => $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($crate::clap_app!{ @group ($builder, $crate::ArgGroup::new(stringify!($name)).$ident(false)) $($tail)* })
+ $($tt)*
+ }
+ };
+ (@app ($builder:expr) (@group $name:ident +$ident:ident => $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($crate::clap_app!{ @group ($builder, $crate::ArgGroup::new(stringify!($name)).$ident(true)) $($tail)* })
+ $($tt)*
+ }
+ };
+// Handle subcommand creation
+ (@app ($builder:expr) (@subcommand $name:ident => $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @app
+ ($builder.subcommand(
+ $crate::clap_app!{ @app ($crate::Command::new(stringify!($name))) $($tail)* }
+ ))
+ $($tt)*
+ }
+ };
+// Yaml like function calls - used for setting various meta directly against the app
+ (@app ($builder:expr) ($ident:ident: $($v:expr),*) $($tt:tt)*) => {
+// $crate::clap_app!{ @app ($builder.$ident($($v),*)) $($tt)* }
+ $crate::clap_app!{ @app
+ ($builder.$ident($($v),*))
+ $($tt)*
+ }
+ };
+
+// Add members to group and continue argument handling with the parent builder
+ (@group ($builder:expr, $group:expr)) => { $builder.group($group) };
+ // Treat the group builder as an argument to set its attributes
+ (@group ($builder:expr, $group:expr) (@attributes $($attr:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @group ($builder, $crate::clap_app!{ @arg ($group) (-) $($attr)* }) $($tt)* }
+ };
+ (@group ($builder:expr, $group:expr) (@arg $name:ident: $($tail:tt)*) $($tt:tt)*) => {
+ $crate::clap_app!{ @group
+ ($crate::clap_app!{ @app ($builder) (@arg $name: $($tail)*) },
+ $group.arg(stringify!($name)))
+ $($tt)*
+ }
+ };
+
+// No more tokens to munch
+ (@arg ($arg:expr) $modes:tt) => { $arg };
+// Shorthand tokens influenced by the usage_string
+ (@arg ($arg:expr) $modes:tt --($long:expr) $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.long($long)) $modes $($tail)* }
+ };
+ (@arg ($arg:expr) $modes:tt --$long:ident $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.long(stringify!($long))) $modes $($tail)* }
+ };
+ (@arg ($arg:expr) $modes:tt -$short:ident $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.short(stringify!($short).chars().next().unwrap())) $modes $($tail)* }
+ };
+ (@arg ($arg:expr) (-) <$var:ident> $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value +required $($tail)* }
+ };
+ (@arg ($arg:expr) (+) <$var:ident> $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) $($tail)* }
+ };
+ (@arg ($arg:expr) (-) [$var:ident] $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value $($tail)* }
+ };
+ (@arg ($arg:expr) (+) [$var:ident] $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) $($tail)* }
+ };
+ (@arg ($arg:expr) $modes:tt ... $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg) $modes +multiple +takes_value $($tail)* }
+ };
+// Shorthand magic
+ (@arg ($arg:expr) $modes:tt #{$n:expr, $m:expr} $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg) $modes min_values($n) max_values($m) $($tail)* }
+ };
+ (@arg ($arg:expr) $modes:tt * $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg) $modes +required $($tail)* }
+ };
+// !foo -> .foo(false)
+ (@arg ($arg:expr) $modes:tt !$ident:ident $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.$ident(false)) $modes $($tail)* }
+ };
+// +foo -> .foo(true)
+ (@arg ($arg:expr) $modes:tt +$ident:ident $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.$ident(true)) $modes $($tail)* }
+ };
+// Validator
+ (@arg ($arg:expr) $modes:tt {$fn_:expr} $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.validator($fn_)) $modes $($tail)* }
+ };
+ (@as_expr $expr:expr) => { $expr };
+// Help
+ (@arg ($arg:expr) $modes:tt $desc:tt) => { $arg.help($crate::clap_app!{ @as_expr $desc }) };
+// Handle functions that need to be called multiple times for each argument
+ (@arg ($arg:expr) $modes:tt $ident:ident[$($target:ident)*] $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg $( .$ident(stringify!($target)) )*) $modes $($tail)* }
+ };
+// Inherit builder's functions, e.g. `index(2)`, `requires_if("val", "arg")`
+ (@arg ($arg:expr) $modes:tt $ident:ident($($expr:expr),*) $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.$ident($($expr),*)) $modes $($tail)* }
+ };
+// Inherit builder's functions with trailing comma, e.g. `index(2,)`, `requires_if("val", "arg",)`
+ (@arg ($arg:expr) $modes:tt $ident:ident($($expr:expr,)*) $($tail:tt)*) => {
+ $crate::clap_app!{ @arg ($arg.$ident($($expr),*)) $modes $($tail)* }
+ };
+
+// Build a subcommand outside of an app.
+ (@subcommand $name:ident => $($tail:tt)*) => {
+ $crate::clap_app!{ @app ($crate::Command::new(stringify!($name))) $($tail)* }
+ };
+// Start the magic
+ (($name:expr) => $($tail:tt)*) => {{
+ $crate::clap_app!{ @app ($crate::Command::new($name)) $($tail)*}
+ }};
+
+ ($name:ident => $($tail:tt)*) => {{
+ $crate::clap_app!{ @app ($crate::Command::new(stringify!($name))) $($tail)*}
+ }};
+}
+
+macro_rules! impl_settings {
+ ($settings:ident, $flags:ident,
+ $(
+ $(#[$inner:ident $($args:tt)*])*
+ $setting:ident => $flag:path
+ ),+
+ ) => {
+ impl $flags {
+ #[allow(dead_code)]
+ pub(crate) fn empty() -> Self {
+ $flags(Flags::empty())
+ }
+
+ #[allow(dead_code)]
+ pub(crate) fn insert(&mut self, rhs: Self) {
+ self.0.insert(rhs.0);
+ }
+
+ #[allow(dead_code)]
+ pub(crate) fn remove(&mut self, rhs: Self) {
+ self.0.remove(rhs.0);
+ }
+
+ #[allow(dead_code)]
+ pub(crate) fn set(&mut self, s: $settings) {
+ #[allow(deprecated)] // some Settings might be deprecated
+ match s {
+ $(
+ $(#[$inner $($args)*])*
+ $settings::$setting => self.0.insert($flag),
+ )*
+ }
+ }
+
+ #[allow(dead_code)]
+ pub(crate) fn unset(&mut self, s: $settings) {
+ #[allow(deprecated)] // some Settings might be deprecated
+ match s {
+ $(
+ $(#[$inner $($args)*])*
+ $settings::$setting => self.0.remove($flag),
+ )*
+ }
+ }
+
+ #[allow(dead_code)]
+ pub(crate) fn is_set(&self, s: $settings) -> bool {
+ #[allow(deprecated)] // some Settings might be deprecated
+ match s {
+ $(
+ $(#[$inner $($args)*])*
+ $settings::$setting => self.0.contains($flag),
+ )*
+ }
+ }
+ }
+
+ impl BitOr for $flags {
+ type Output = Self;
+
+ fn bitor(mut self, rhs: Self) -> Self::Output {
+ self.0.insert(rhs.0);
+ self
+ }
+ }
+
+ impl From<$settings> for $flags {
+ fn from(setting: $settings) -> Self {
+ let mut flags = $flags::empty();
+ flags.set(setting);
+ flags
+ }
+ }
+
+ impl BitOr<$settings> for $flags {
+ type Output = Self;
+
+ fn bitor(mut self, rhs: $settings) -> Self::Output {
+ self.set(rhs);
+ self
+ }
+ }
+
+ impl BitOr for $settings {
+ type Output = $flags;
+
+ fn bitor(self, rhs: Self) -> Self::Output {
+ let mut flags = $flags::empty();
+ flags.set(self);
+ flags.set(rhs);
+ flags
+ }
+ }
+ }
+}
+
+// Convenience for writing to stderr thanks to https://github.com/BurntSushi
+macro_rules! wlnerr {
+ ($($arg:tt)*) => ({
+ use std::io::{Write, stderr};
+ writeln!(&mut stderr(), $($arg)*).ok();
+ })
+}
+
+#[cfg(feature = "debug")]
+macro_rules! debug {
+ ($($arg:tt)*) => ({
+ let prefix = format!("[{:>w$}] \t", module_path!(), w = 28);
+ let body = format!($($arg)*);
+ let mut color = $crate::output::fmt::Colorizer::new($crate::output::fmt::Stream::Stderr, $crate::ColorChoice::Auto);
+ color.hint(prefix);
+ color.hint(body);
+ color.none("\n");
+ let _ = color.print();
+ })
+}
+
+#[cfg(not(feature = "debug"))]
+macro_rules! debug {
+ ($($arg:tt)*) => {};
+}
diff --git a/vendor/clap/src/mkeymap.rs b/vendor/clap-3.2.20/src/mkeymap.rs
index 97ecdda77..97ecdda77 100644
--- a/vendor/clap/src/mkeymap.rs
+++ b/vendor/clap-3.2.20/src/mkeymap.rs
diff --git a/vendor/clap/src/output/fmt.rs b/vendor/clap-3.2.20/src/output/fmt.rs
index dc1f46e08..dc1f46e08 100644
--- a/vendor/clap/src/output/fmt.rs
+++ b/vendor/clap-3.2.20/src/output/fmt.rs
diff --git a/vendor/clap/src/output/help.rs b/vendor/clap-3.2.20/src/output/help.rs
index eb53bfa54..eb53bfa54 100644
--- a/vendor/clap/src/output/help.rs
+++ b/vendor/clap-3.2.20/src/output/help.rs
diff --git a/vendor/clap/src/output/mod.rs b/vendor/clap-3.2.20/src/output/mod.rs
index e32aac26a..e32aac26a 100644
--- a/vendor/clap/src/output/mod.rs
+++ b/vendor/clap-3.2.20/src/output/mod.rs
diff --git a/vendor/clap/src/output/usage.rs b/vendor/clap-3.2.20/src/output/usage.rs
index 7adaf58c6..6f7a2cad4 100644
--- a/vendor/clap/src/output/usage.rs
+++ b/vendor/clap-3.2.20/src/output/usage.rs
@@ -382,73 +382,64 @@ impl<'help, 'cmd> Usage<'help, 'cmd> {
unrolled_reqs
);
- let args_in_groups = self
- .cmd
- .get_groups()
- .filter(|gn| required.contains(&gn.id))
- .flat_map(|g| self.cmd.unroll_args_in_group(&g.id))
- .collect::<Vec<_>>();
-
- for a in unrolled_reqs
- .iter()
- .chain(incls.iter())
- .filter(|name| !self.cmd.get_positionals().any(|p| &&p.id == name))
- .filter(|name| !self.cmd.get_groups().any(|g| &&g.id == name))
- .filter(|name| !args_in_groups.contains(name))
- .filter(|name| {
- !(matcher.is_some()
- && matcher
- .as_ref()
- .unwrap()
- .check_explicit(name, ArgPredicate::IsPresent))
- })
- {
- debug!("Usage::get_required_usage_from:iter:{:?}", a);
- let arg = self.cmd.find(a).expect(INTERNAL_ERROR_MSG).to_string();
- ret_val.insert(arg);
- }
- let mut g_vec: Vec<String> = vec![];
- for g in unrolled_reqs
- .iter()
- .filter(|n| self.cmd.get_groups().any(|g| g.id == **n))
- {
- // don't print requirement for required groups that have an arg.
- if let Some(m) = matcher {
- let have_group_entry = self
- .cmd
- .unroll_args_in_group(g)
- .iter()
- .any(|arg| m.check_explicit(arg, ArgPredicate::IsPresent));
- if have_group_entry {
- continue;
+ let mut required_groups_members = IndexSet::new();
+ let mut required_opts = IndexSet::new();
+ let mut required_groups = IndexSet::new();
+ let mut required_positionals = Vec::new();
+ for req in unrolled_reqs.iter().chain(incls.iter()) {
+ if let Some(arg) = self.cmd.find(req) {
+ let is_present = matcher
+ .map(|m| m.check_explicit(req, ArgPredicate::IsPresent))
+ .unwrap_or(false);
+ debug!(
+ "Usage::get_required_usage_from:iter:{:?} arg is_present={}",
+ req, is_present
+ );
+ if !is_present {
+ if arg.is_positional() {
+ if incl_last || !arg.is_last_set() {
+ required_positionals.push((arg.index.unwrap(), arg.to_string()));
+ }
+ } else {
+ required_opts.insert(arg.to_string());
+ }
+ }
+ } else {
+ debug_assert!(self.cmd.find_group(req).is_some());
+ let group_members = self.cmd.unroll_args_in_group(req);
+ let is_present = matcher
+ .map(|m| {
+ group_members
+ .iter()
+ .any(|arg| m.check_explicit(arg, ArgPredicate::IsPresent))
+ })
+ .unwrap_or(false);
+ debug!(
+ "Usage::get_required_usage_from:iter:{:?} group is_present={}",
+ req, is_present
+ );
+ if !is_present {
+ let elem = self.cmd.format_group(req);
+ required_groups.insert(elem);
+ required_groups_members.extend(
+ group_members
+ .iter()
+ .flat_map(|id| self.cmd.find(id))
+ .map(|arg| arg.to_string()),
+ );
}
- }
-
- let elem = self.cmd.format_group(g);
- if !g_vec.contains(&elem) {
- g_vec.push(elem);
}
}
- ret_val.extend(g_vec);
- let mut pvec = unrolled_reqs
- .iter()
- .chain(incls.iter())
- .filter(|a| self.cmd.get_positionals().any(|p| &&p.id == a))
- .filter(|&pos| {
- matcher.map_or(true, |m| !m.check_explicit(pos, ArgPredicate::IsPresent))
- })
- .filter_map(|pos| self.cmd.find(pos))
- .filter(|&pos| incl_last || !pos.is_last_set())
- .filter(|pos| !args_in_groups.contains(&pos.id))
- .map(|pos| (pos.index.unwrap(), pos))
- .collect::<Vec<(usize, &Arg)>>();
- pvec.sort_by_key(|(ind, _)| *ind); // sort by index
-
- for (_, p) in pvec {
- debug!("Usage::get_required_usage_from:push:{:?}", p.id);
- if !args_in_groups.contains(&p.id) {
- ret_val.insert(p.to_string());
+ required_opts.retain(|arg| !required_groups_members.contains(arg));
+ ret_val.extend(required_opts);
+
+ ret_val.extend(required_groups);
+
+ required_positionals.sort_by_key(|(ind, _)| *ind); // sort by index
+ for (_, p) in required_positionals {
+ if !required_groups_members.contains(&p) {
+ ret_val.insert(p);
}
}
diff --git a/vendor/clap/src/parser/arg_matcher.rs b/vendor/clap-3.2.20/src/parser/arg_matcher.rs
index 8d15c5799..22087e722 100644
--- a/vendor/clap/src/parser/arg_matcher.rs
+++ b/vendor/clap-3.2.20/src/parser/arg_matcher.rs
@@ -74,9 +74,7 @@ impl ArgMatcher {
// a default value of `other` myprog would have an existing MatchedArg for
// `--global-arg` where the value is `other`
let to_update = if let Some(parent_ma) = vals_map.get(global_arg) {
- if parent_ma.check_explicit(ArgPredicate::IsPresent)
- && !ma.check_explicit(ArgPredicate::IsPresent)
- {
+ if parent_ma.source() > ma.source() {
parent_ma
} else {
ma
diff --git a/vendor/clap-3.2.20/src/parser/error.rs b/vendor/clap-3.2.20/src/parser/error.rs
new file mode 100644
index 000000000..caeba4b8f
--- /dev/null
+++ b/vendor/clap-3.2.20/src/parser/error.rs
@@ -0,0 +1,67 @@
+use crate::util::Id;
+
+/// Violation of [`ArgMatches`][crate::ArgMatches] assumptions
+#[derive(Clone, Debug)]
+#[allow(missing_copy_implementations)] // We might add non-Copy types in the future
+#[non_exhaustive]
+pub enum MatchesError {
+ /// Failed to downcast `AnyValue` to the specified type
+ #[non_exhaustive]
+ Downcast {
+ /// Type for value stored in [`ArgMatches`][crate::ArgMatches]
+ actual: super::AnyValueId,
+ /// The target type to downcast to
+ expected: super::AnyValueId,
+ },
+ /// Argument not defined in [`Command`][crate::Command]
+ #[non_exhaustive]
+ UnknownArgument {
+ // Missing `id` but blocked on a public id type which will hopefully come with `unstable-v4`
+ },
+}
+
+impl MatchesError {
+ #[track_caller]
+ pub(crate) fn unwrap<T>(id: &Id, r: Result<T, MatchesError>) -> T {
+ let err = match r {
+ Ok(t) => {
+ return t;
+ }
+ Err(err) => err,
+ };
+ panic!(
+ "Mismatch between definition and access of `{:?}`. {}",
+ id, err
+ )
+ }
+}
+
+impl std::error::Error for MatchesError {}
+
+impl std::fmt::Display for MatchesError {
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+ match self {
+ Self::Downcast { actual, expected } => {
+ writeln!(
+ f,
+ "Could not downcast to {:?}, need to downcast to {:?}",
+ expected, actual
+ )
+ }
+ Self::UnknownArgument {} => {
+ writeln!(f, "Unknown argument or group id. Make sure you are using the argument id and not the short or long flags")
+ }
+ }
+ }
+}
+
+#[test]
+fn check_auto_traits() {
+ static_assertions::assert_impl_all!(
+ MatchesError: Send,
+ Sync,
+ std::panic::RefUnwindSafe,
+ std::panic::UnwindSafe,
+ Unpin
+ );
+}
diff --git a/vendor/clap/src/parser/features/mod.rs b/vendor/clap-3.2.20/src/parser/features/mod.rs
index bdeb766ec..bdeb766ec 100644
--- a/vendor/clap/src/parser/features/mod.rs
+++ b/vendor/clap-3.2.20/src/parser/features/mod.rs
diff --git a/vendor/clap/src/parser/features/suggestions.rs b/vendor/clap-3.2.20/src/parser/features/suggestions.rs
index 9e46f3c9e..9e46f3c9e 100644
--- a/vendor/clap/src/parser/features/suggestions.rs
+++ b/vendor/clap-3.2.20/src/parser/features/suggestions.rs
diff --git a/vendor/clap/src/parser/matches/any_value.rs b/vendor/clap-3.2.20/src/parser/matches/any_value.rs
index a9277e75f..a9277e75f 100644
--- a/vendor/clap/src/parser/matches/any_value.rs
+++ b/vendor/clap-3.2.20/src/parser/matches/any_value.rs
diff --git a/vendor/clap/src/parser/matches/arg_matches.rs b/vendor/clap-3.2.20/src/parser/matches/arg_matches.rs
index 17fa63ca6..2585c0219 100644
--- a/vendor/clap/src/parser/matches/arg_matches.rs
+++ b/vendor/clap-3.2.20/src/parser/matches/arg_matches.rs
@@ -119,6 +119,69 @@ impl ArgMatches {
MatchesError::unwrap(&internal_id, self.try_get_one(id))
}
+ /// Gets the value of a specific [`ArgAction::Count`][crate::ArgAction::Count] flag
+ ///
+ /// # Panic
+ ///
+ /// If the argument's action is not [`ArgAction::Count`][crate::ArgAction::Count]
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::Command;
+ /// # use clap::Arg;
+ /// let cmd = Command::new("mycmd")
+ /// .arg(
+ /// Arg::new("flag")
+ /// .long("flag")
+ /// .action(clap::ArgAction::Count)
+ /// );
+ ///
+ /// let matches = cmd.clone().try_get_matches_from(["mycmd", "--flag", "--flag"]).unwrap();
+ /// assert_eq!(
+ /// matches.get_count("flag"),
+ /// 2
+ /// );
+ /// ```
+ #[track_caller]
+ pub fn get_count(&self, id: &str) -> u8 {
+ *self
+ .get_one::<u8>(id)
+ .expect("ArgAction::Count is defaulted")
+ }
+
+ /// Gets the value of a specific [`ArgAction::SetTrue`][crate::ArgAction::SetTrue] or [`ArgAction::SetFalse`][crate::ArgAction::SetFalse] flag
+ ///
+ /// # Panic
+ ///
+ /// If the argument's action is not [`ArgAction::SetTrue`][crate::ArgAction::SetTrue] or [`ArgAction::SetFalse`][crate::ArgAction::SetFalse]
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// # use clap::Command;
+ /// # use clap::Arg;
+ /// let cmd = Command::new("mycmd")
+ /// .arg(
+ /// Arg::new("flag")
+ /// .long("flag")
+ /// .action(clap::ArgAction::SetTrue)
+ /// );
+ ///
+ /// let matches = cmd.clone().try_get_matches_from(["mycmd", "--flag", "--flag"]).unwrap();
+ /// assert!(matches.contains_id("flag"));
+ /// assert_eq!(
+ /// matches.get_flag("flag"),
+ /// true
+ /// );
+ /// ```
+ #[track_caller]
+ pub fn get_flag(&self, id: &str) -> bool {
+ *self
+ .get_one::<bool>(id)
+ .expect("ArgAction::SetTrue / ArgAction::SetFalse is defaulted")
+ }
+
/// Iterate over values of a specific option or positional argument.
///
/// i.e. an argument that takes multiple values at runtime.
@@ -604,13 +667,13 @@ impl ArgMatches {
value.and_then(MatchedArg::source)
}
- /// Deprecated, replaced with [`ArgAction::Count`][crate::ArgAction] or
- /// [`ArgMatches::get_many`]`.len()`.
+ /// Deprecated, replaced with [`ArgAction::Count`][crate::ArgAction],
+ /// [`ArgMatches::get_many`]`.len()`, or [`ArgMatches::value_source`].
#[cfg_attr(
feature = "deprecated",
deprecated(
since = "3.2.0",
- note = "Replaced with either `ArgAction::Count` or `ArgMatches::get_many(...).len()`"
+ note = "Replaced with either `ArgAction::Count`, `ArgMatches::get_many(...).len()`, or `ArgMatches::value_source`"
)
)]
#[cfg_attr(debug_assertions, track_caller)]
@@ -1742,6 +1805,11 @@ mod tests {
use super::*;
#[test]
+ fn check_auto_traits() {
+ static_assertions::assert_impl_all!(ArgMatches: Send, Sync, Unpin);
+ }
+
+ #[test]
fn test_default_values() {
#![allow(deprecated)]
let mut values: Values = Values::default();
diff --git a/vendor/clap/src/parser/matches/matched_arg.rs b/vendor/clap-3.2.20/src/parser/matches/matched_arg.rs
index fde6d37f3..fde6d37f3 100644
--- a/vendor/clap/src/parser/matches/matched_arg.rs
+++ b/vendor/clap-3.2.20/src/parser/matches/matched_arg.rs
diff --git a/vendor/clap/src/parser/matches/mod.rs b/vendor/clap-3.2.20/src/parser/matches/mod.rs
index 7b88eeca7..7b88eeca7 100644
--- a/vendor/clap/src/parser/matches/mod.rs
+++ b/vendor/clap-3.2.20/src/parser/matches/mod.rs
diff --git a/vendor/clap/src/parser/matches/value_source.rs b/vendor/clap-3.2.20/src/parser/matches/value_source.rs
index fb762d2af..fb762d2af 100644
--- a/vendor/clap/src/parser/matches/value_source.rs
+++ b/vendor/clap-3.2.20/src/parser/matches/value_source.rs
diff --git a/vendor/clap/src/parser/mod.rs b/vendor/clap-3.2.20/src/parser/mod.rs
index da81648e1..da81648e1 100644
--- a/vendor/clap/src/parser/mod.rs
+++ b/vendor/clap-3.2.20/src/parser/mod.rs
diff --git a/vendor/clap/src/parser/parser.rs b/vendor/clap-3.2.20/src/parser/parser.rs
index fc95dad22..ad2bc6e9c 100644
--- a/vendor/clap/src/parser/parser.rs
+++ b/vendor/clap-3.2.20/src/parser/parser.rs
@@ -98,77 +98,6 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
arg_os.to_value_os().as_raw_bytes()
);
- // Correct pos_counter.
- pos_counter = {
- let is_second_to_last = pos_counter + 1 == positional_count;
-
- // The last positional argument, or second to last positional
- // argument may be set to .multiple_values(true) or `.multiple_occurrences(true)`
- let low_index_mults = is_second_to_last
- && self
- .cmd
- .get_positionals()
- .any(|a| a.is_multiple() && (positional_count != a.index.unwrap_or(0)))
- && self
- .cmd
- .get_positionals()
- .last()
- .map_or(false, |p_name| !p_name.is_last_set());
-
- let missing_pos = self.cmd.is_allow_missing_positional_set()
- && is_second_to_last
- && !trailing_values;
-
- debug!(
- "Parser::get_matches_with: Positional counter...{}",
- pos_counter
- );
- debug!(
- "Parser::get_matches_with: Low index multiples...{:?}",
- low_index_mults
- );
-
- if low_index_mults || missing_pos {
- let skip_current = if let Some(n) = raw_args.peek(&args_cursor) {
- if let Some(arg) = self
- .cmd
- .get_positionals()
- .find(|a| a.index == Some(pos_counter))
- {
- // If next value looks like a new_arg or it's a
- // subcommand, skip positional argument under current
- // pos_counter(which means current value cannot be a
- // positional argument with a value next to it), assume
- // current value matches the next arg.
- self.is_new_arg(&n, arg)
- || self
- .possible_subcommand(n.to_value(), valid_arg_found)
- .is_some()
- } else {
- true
- }
- } else {
- true
- };
-
- if skip_current {
- debug!("Parser::get_matches_with: Bumping the positional counter...");
- pos_counter + 1
- } else {
- pos_counter
- }
- } else if trailing_values
- && (self.cmd.is_allow_missing_positional_set() || contains_last)
- {
- // Came to -- and one positional has .last(true) set, so we go immediately
- // to the last (highest index) positional
- debug!("Parser::get_matches_with: .last(true) and --, setting last pos");
- positional_count
- } else {
- pos_counter
- }
- };
-
// Has the user already passed '--'? Meaning only positional args follow
if !trailing_values {
if self.cmd.is_subcommand_precedence_over_arg_set()
@@ -376,6 +305,77 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
}
}
+ // Correct pos_counter.
+ pos_counter = {
+ let is_second_to_last = pos_counter + 1 == positional_count;
+
+ // The last positional argument, or second to last positional
+ // argument may be set to .multiple_values(true) or `.multiple_occurrences(true)`
+ let low_index_mults = is_second_to_last
+ && self
+ .cmd
+ .get_positionals()
+ .any(|a| a.is_multiple() && (positional_count != a.index.unwrap_or(0)))
+ && self
+ .cmd
+ .get_positionals()
+ .last()
+ .map_or(false, |p_name| !p_name.is_last_set());
+
+ let missing_pos = self.cmd.is_allow_missing_positional_set()
+ && is_second_to_last
+ && !trailing_values;
+
+ debug!(
+ "Parser::get_matches_with: Positional counter...{}",
+ pos_counter
+ );
+ debug!(
+ "Parser::get_matches_with: Low index multiples...{:?}",
+ low_index_mults
+ );
+
+ if low_index_mults || missing_pos {
+ let skip_current = if let Some(n) = raw_args.peek(&args_cursor) {
+ if let Some(arg) = self
+ .cmd
+ .get_positionals()
+ .find(|a| a.index == Some(pos_counter))
+ {
+ // If next value looks like a new_arg or it's a
+ // subcommand, skip positional argument under current
+ // pos_counter(which means current value cannot be a
+ // positional argument with a value next to it), assume
+ // current value matches the next arg.
+ self.is_new_arg(&n, arg)
+ || self
+ .possible_subcommand(n.to_value(), valid_arg_found)
+ .is_some()
+ } else {
+ true
+ }
+ } else {
+ true
+ };
+
+ if skip_current {
+ debug!("Parser::get_matches_with: Bumping the positional counter...");
+ pos_counter + 1
+ } else {
+ pos_counter
+ }
+ } else if trailing_values
+ && (self.cmd.is_allow_missing_positional_set() || contains_last)
+ {
+ // Came to -- and one positional has .last(true) set, so we go immediately
+ // to the last (highest index) positional
+ debug!("Parser::get_matches_with: .last(true) and --, setting last pos");
+ positional_count
+ } else {
+ pos_counter
+ }
+ };
+
if let Some(arg) = self.cmd.get_keymap().get(&pos_counter) {
if arg.is_last_set() && !trailing_values {
let _ = self.resolve_pending(matcher);
@@ -738,8 +738,10 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
}
};
if long_arg.is_empty() {
- debug_assert!(long_value.is_none(), "{:?}", long_value);
- return Ok(ParseResult::NoArg);
+ debug_assert!(
+ long_value.is_some(),
+ "`--` should be filtered out before this point"
+ );
}
let arg = if let Some(arg) = self.cmd.get_keymap().get(long_arg) {
diff --git a/vendor/clap/src/parser/validator.rs b/vendor/clap-3.2.20/src/parser/validator.rs
index ebf2b234d..ebf2b234d 100644
--- a/vendor/clap/src/parser/validator.rs
+++ b/vendor/clap-3.2.20/src/parser/validator.rs
diff --git a/vendor/clap/src/util/color.rs b/vendor/clap-3.2.20/src/util/color.rs
index 15c9901a0..15c9901a0 100644
--- a/vendor/clap/src/util/color.rs
+++ b/vendor/clap-3.2.20/src/util/color.rs
diff --git a/vendor/clap/src/util/fnv.rs b/vendor/clap-3.2.20/src/util/fnv.rs
index 4602300a4..4602300a4 100644
--- a/vendor/clap/src/util/fnv.rs
+++ b/vendor/clap-3.2.20/src/util/fnv.rs
diff --git a/vendor/clap/src/util/graph.rs b/vendor/clap-3.2.20/src/util/graph.rs
index d646400b0..d646400b0 100644
--- a/vendor/clap/src/util/graph.rs
+++ b/vendor/clap-3.2.20/src/util/graph.rs
diff --git a/vendor/clap/src/util/id.rs b/vendor/clap-3.2.20/src/util/id.rs
index 63a7e003e..63a7e003e 100644
--- a/vendor/clap/src/util/id.rs
+++ b/vendor/clap-3.2.20/src/util/id.rs
diff --git a/vendor/clap/src/util/mod.rs b/vendor/clap-3.2.20/src/util/mod.rs
index 8adc8db17..8adc8db17 100644
--- a/vendor/clap/src/util/mod.rs
+++ b/vendor/clap-3.2.20/src/util/mod.rs
diff --git a/vendor/clap/src/util/str_to_bool.rs b/vendor/clap-3.2.20/src/util/str_to_bool.rs
index 1fbdc7531..1fbdc7531 100644
--- a/vendor/clap/src/util/str_to_bool.rs
+++ b/vendor/clap-3.2.20/src/util/str_to_bool.rs
diff --git a/vendor/clap/.cargo-checksum.json b/vendor/clap/.cargo-checksum.json
deleted file mode 100644
index 729aee79b..000000000
--- a/vendor/clap/.cargo-checksum.json
+++ /dev/null
@@ -1 +0,0 @@
-{"files":{"Cargo.lock":"6d96d441076749454963df06d637e5680e5ecdcdd36026f160c2d181aaca3bdc","Cargo.toml":"cb59c1e945c5606119203d907c01a40606070414b8913440f32e250c5db8c211","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5","README.md":"b5d5ba727e9f1a8797016bb041bc7888a209099d7dc42e445a89b1f8d3ac510d","examples/README.md":"9d19f6dfb53aadbe18aca773136d34bd28352b8efd69dfee217f26ee0eb9269a","examples/cargo-example-derive.md":"53a35e48cd04dfa10d70f99eb6d97d0d74110958f7f9e4ffc460fca87a256a73","examples/cargo-example-derive.rs":"627a74b7dc6d829b8facd314d0de46418b2420c6998e883f71a3cb7639d3a22d","examples/cargo-example.md":"1f270b0a0ac9122feb9cdac0887c1c1bcf1b654fed27147871c9cfe71851a4d9","examples/cargo-example.rs":"66293c7e200a87fceca691ab858293142c8a1536ef1d2c0dd14a6056289866a2","examples/demo.md":"3e986afca0863142fdd4cc092b5969fba32a70fac8adf84a55bd652f4b30eedb","examples/demo.rs":"5361cac70b662dd6d4d785738b99cfadf1f838c90507f19ea1aeef05aba0ee72","examples/derive_ref/README.md":"be2cfd81b9e2dc5e5910243f4b2f032e0b2c8af0592dcd050705e8718be8038d","examples/derive_ref/augment_args.rs":"69057536807ceb08e35802f8cf65c0f6ddd260a66a90000c8c6294031d466be3","examples/derive_ref/augment_subcommands.rs":"5535f8ca1893101acb5eba8edc311497431ff9aa26f62f1d9743bdc147bef7a4","examples/derive_ref/custom-bool.md":"d92e441199c7584d4b888c45124366cc4802ec8ea67cdcbb3423ffaa3c5268ac","examples/derive_ref/custom-bool.rs":"f88e9c68d2447a24bc98e05124fea17836155f32cff30a2b8a03ad254383247c","examples/derive_ref/flatten_hand_args.rs":"c09b751eb4e89e825af4de25a67d735c7b4794536bcff96b0ab8ee816c34413a","examples/derive_ref/hand_subcommand.rs":"1a5464b9c5791361930b5591adeb6fcf6f14b83abdfa6443d2c80bcf0c097b3e","examples/derive_ref/interop_tests.md":"3a357e82cfc155f71e0348be33f78295aa77839c3e3a5b7c1783cbd1259e6a61","examples/escaped-positional-derive.md":"b2190ada5ad2634c3ceb7f9d98293512628762545f9519579cbee9867c6a406a","examples/escaped-positional-derive.rs":"ac3127e8cc7a8953886778824a4d6e12470488546f10eeac6f9817ecaef1532e","examples/escaped-positional.md":"b6a5c103f5cea1464b5ac8e63e1964f032a4dbb4a908e45b9b391f4857fe2684","examples/escaped-positional.rs":"aaf106cdbe8f1eb5d9f3032df485d5661885f95402f026a34c42431f98a08323","examples/git-derive.md":"1a20f30d1c6df28d7e48b527b0726e9440f54d55a1e0b9e059b2322a7960ee72","examples/git-derive.rs":"225a33b0cd84840de2ba623b6b506b2fa4b02a9f5fbf62cdc2b2626e661501bd","examples/git.md":"acb3a44f954a6e2160f8989952981fb4baea8b97b921e4227c67896bc64d5e4a","examples/git.rs":"293b1289550ea38eabf1af7c6a855065170ff785e97be113928f045c50c1a3e9","examples/multicall-busybox.md":"3cb9d00ad110fc99c298dac4aa471e2f7a304aecef51d2eda67f5fbf36c41293","examples/multicall-busybox.rs":"709f71a82295a539d0a239371d35d1eeb517eaa3bb0a4db406bb7e5d3541a4a5","examples/multicall-hostname.md":"8c2d95fa8b940d4f788f96cf6b08b81bb2541bf12adff63bdff90dfc24567c7e","examples/multicall-hostname.rs":"cc58a924dd2e57281f36e30481a1cbc8186952adbf149f9e1e13f9c673614fd9","examples/pacman.md":"e583ef465e55fa2fffef3b121e4a90835b8905ef3ffe2ec9ae91702832b7392d","examples/pacman.rs":"4aea4eed4408458d57d3ff91f0e7f8833eeee30dd71043f5a6d06968c6c9712e","examples/repl.rs":"d50c1da634c237b26989994b1efa6fd1a087874a82d1fc8c1863be4ea8deaa8c","examples/tutorial_builder/01_quick.rs":"2734001dc1f67842f8ff3486397738f10dcbdf4bdd15326c13aebd5fafe0dabd","examples/tutorial_builder/02_app_settings.rs":"ca7e0b49019a444053ed13a7df8108d460430819b4fb04c4c6097225dc630293","examples/tutorial_builder/02_apps.rs":"a7016469d10259ae0025fb6ad5b9d3c732cf082869348005d4774d2bb0722d2d","examples/tutorial_builder/02_crate.rs":"5d7397901ebf82e3975626b3737fca3a95868cde42ce74d41bb3c96429878906","examples/tutorial_builder/03_01_flag_bool.rs":"1e904b39c7aaafc407a841ab8b549152263073a1af11773d13dc04d43fd541ef","examples/tutorial_builder/03_01_flag_count.rs":"02778a53afd6170c7ef7d358909237d4fe548adc5d7e650916d26f765040c25b","examples/tutorial_builder/03_02_option.rs":"7bca1c12b4904f89516ebdb88019c959c5adcf2a84244047f988b71f82760bd4","examples/tutorial_builder/03_03_positional.rs":"290921224b17df7f77326df06421b2100462da143e7b5dbe014f7e8b6d727d2b","examples/tutorial_builder/03_04_subcommands.rs":"1d5769847403661b1bb82d7a39713c52e1decbe4027dfc3866d63f5cf6ae8a55","examples/tutorial_builder/03_05_default_values.rs":"5a4768214c57996b27989cd5af57c7b79cbccfab2f285a88a415c2b67b589e4b","examples/tutorial_builder/04_01_enum.rs":"813ce1cf91e2cacd7eb5bd7018b1125d41cd9b29970dfa3638a7cf73c06659a0","examples/tutorial_builder/04_01_possible.rs":"2ccba0ab59f6339bcd761160d17a1c7ec935716fbe137408338694c7d3ee56f0","examples/tutorial_builder/04_02_parse.rs":"9d022cb3a3af3e00fd6c7d647ee0915a275ce79e379676e98bebcd3484be344b","examples/tutorial_builder/04_02_validate.rs":"4450e7e1af3581be631ffe9afa363c88b44ee20a90ecbb4608246972d3f7fd93","examples/tutorial_builder/04_03_relations.rs":"90db469ca8a3f1c5eb90548e8c1c0afe796d163891bdac90f2d307949a400047","examples/tutorial_builder/04_04_custom.rs":"461a06cae62f5972937f71b42d04df44240dabd62e23058322f04026beceaec5","examples/tutorial_builder/05_01_assert.rs":"73c57b051550366ed412c8986f40549fd43dacf3894df7751313c5de16f46af1","examples/tutorial_builder/README.md":"027d95d9f951d4ffed9ec54a3950919ea4a3d9fd471bbda721151ed6ff6c5731","examples/tutorial_derive/01_quick.rs":"e17262c915199c4507d8950d5eafb73f3047e09b6dee2abbfe9f82ebf1b7ddd5","examples/tutorial_derive/02_app_settings.rs":"7e81f4c1640b0bfbd87aedd3eda79ae7c47c669dee79b643b35e54c1dc076ee8","examples/tutorial_derive/02_apps.rs":"e8cd02b5983b2203f1585b96858fade4cedfb124e366171d6b21fcb3f05b514e","examples/tutorial_derive/02_crate.rs":"c156589c36a8b21654b1a41f5f10240411053d3273e7af3797e91ca53fa61d28","examples/tutorial_derive/03_01_flag_bool.rs":"07c31218d0332d7437d80e19c7e3c7be711bf0f56bee3ffb1c4d6f7f253b9304","examples/tutorial_derive/03_01_flag_count.rs":"945be42994845145b9c579b3834f8c6375f239293ded84fba35754bbe9fdcf9b","examples/tutorial_derive/03_02_option.rs":"48be4cf49b498173200ad86d5d3cd64ce9381f86fdaaab70f05fc471f64a2185","examples/tutorial_derive/03_03_positional.rs":"f368ab1465ee4d84b84d175b97af6f64ce0676bec2482adef3ce966d2d8de26a","examples/tutorial_derive/03_04_subcommands.rs":"b25c8aec8f3816923b1154be91caafe0c2d2841fc1af5f0ef048f03d1273879e","examples/tutorial_derive/03_04_subcommands_alt.rs":"7ba6e81c2af6085b7e2721254500b34ee3e8622e20790b3c6f2786e165151b70","examples/tutorial_derive/03_05_default_values.rs":"0ba14153a3c72a2435ac3688b990171a1670eb3f2f7cef21886732e489fad435","examples/tutorial_derive/04_01_enum.rs":"a665af77196af86ba87f1725703011392fc27f24e3d442bbb5dfc4c0d4892c15","examples/tutorial_derive/04_02_parse.rs":"fbb23ef2d98d3cb401cec9dd29d5818e4c189cc9f54fe961a2fbd08632a9634c","examples/tutorial_derive/04_02_validate.rs":"87d9c465f912b69e5839ea87404a221a39421404012c1a7fd6e327b03ceb12f0","examples/tutorial_derive/04_03_relations.rs":"bfc12e66ad9c17182bed2ef86cd668242e6e87ab4ee20fa9bf3d2aa99385d61a","examples/tutorial_derive/04_04_custom.rs":"0e745c6dab0881c62190e82e01409b70cf3286dd0983db4a612f1be88fdd1a8d","examples/tutorial_derive/05_01_assert.rs":"4742d883a3446f32068d96c142ed18df40a50ad6ed4989e39980011f3d1adbdf","examples/tutorial_derive/README.md":"7902da25a153aa0032184e4ca54185d1a5d4c6aa53686b10a210b4decc276791","examples/typed-derive.md":"cf3ee8313709937cc9c5462e3826cca8679946a658d684e8a36e66b0950100a7","examples/typed-derive.rs":"67034bd557c0efb2a0b61ced263cab3ddddb4e4a2bff2f2901d4832f6961e17d","src/bin/stdio-fixture.rs":"e8f10afbfe1857bcf986d2f55be0ca19a50c905d9f650c6e1fd42dbacf219b04","src/builder/action.rs":"64633d218202f799a08fb43ce7f1fae6105ae5ed43386caf4aca2d8ac5352fc1","src/builder/app_settings.rs":"5a27df52d765b50f83ad1173525b66f92b156415aee62b238306b3b57c086e50","src/builder/arg.rs":"808037bb9e7084c27f9f136059653ab049630d07d9851e5e700c8a775655bd05","src/builder/arg_group.rs":"263d9c79e03015fe4e2fab4616fc73089be60fb2ec17aa2a06f3d6a24740432c","src/builder/arg_predicate.rs":"8c9fd14780cd42465f32f2e8927b97c06e686d09b5927ba3cd5bbd792af7a13d","src/builder/arg_settings.rs":"af739627b9b1451c633eb66b09536008d8b095cba518a4f28b82ea480e9400d6","src/builder/command.rs":"72d0031bce35aa6d6ebd6a2006fe26a9b222852fe5a58a23854d9ab7f27150c5","src/builder/debug_asserts.rs":"d1d5adc82cb8269445b2ef197f1e566f61e7f13d6a24afaad928e45e95aed170","src/builder/macros.rs":"904e42e72c49107ae324f45d5df24fbff13b9c7d4589f1a4ae38594add704434","src/builder/mod.rs":"205367cb5ba5d5ba7894091535ce3a5dd23b35fd436e003196d89523e7705566","src/builder/possible_value.rs":"62268b9da9eec8f4d1904ebfbd3a288fb78cfa71c357efadced28f0378bcfb93","src/builder/regex.rs":"b18891310186ecdcca9bb611833b7188cc80fe72e9fef27b63fa076b880a1acb","src/builder/tests.rs":"995c7d6be608b94c6f392f1356eba0cb8adb9ca661ffeebf7ebe6e8ad01a868c","src/builder/usage_parser.rs":"91d1af89196116aac2c0fb021f42f43f954aa3252df264e19a02a0cf5911d16b","src/builder/value_hint.rs":"0dd974d495c313430898d28b79991a70983c9aa44e88fa9aa1776d3308935438","src/builder/value_parser.rs":"1d731b5bf4e25344ae1de23c474255a310852721ecf66a98c5ef2cbca1452437","src/derive.rs":"cf3e108adf7022ef4a269a0ede687d19f8f549168e1f36c3592fbee40da51e61","src/error/context.rs":"1dc561c7877d7f9b90f04bb7915744f0b3cc4ac2aa928ae100b2825a97077142","src/error/kind.rs":"deba40c24adf04e67e87e383463d103907b7f8cc69f842fd3a5d8d81015d33c1","src/error/mod.rs":"c7bdd28240ee2fac6d9ae2c3d849483fabc3c64d5d577c0bc297c996f122a217","src/lib.rs":"9522f2b17cd505623468c5ff847f5aa906a40ae19dde0329c459a417c2b82a2b","src/macros.rs":"d39619976c3cf3b2b28eef3dfffd449080f4fcfbaa164b01901bf3e10d1a5a07","src/mkeymap.rs":"3565a5bae5d6cdcf8ba41a24eb602c510a14e150c4a6d3085ad72a35778e9c5f","src/output/fmt.rs":"efb741b5854500d946c6c09763ece1badc2b9cd3efa616cb58012039836c2b7f","src/output/help.rs":"ebdd123d6b70279c25af4b08432b547498834853adf99821ff6c6cd65dd87d4e","src/output/mod.rs":"3a61f89a4568e95114a3ab839da8f3c4c92de2a228549308f5d1be076a474917","src/output/usage.rs":"370d3544cf58a09f8d3b0bcc2d894531d7152d716eaffa745a858c6ba2e03b7c","src/parser/arg_matcher.rs":"79ab36a164df07e565d2c44b836f647ee2009463d0d55bd2e822cb72b5e009a7","src/parser/error.rs":"4568fb6b8bb05b43e81c5df4fba5f4cb8b19bfa06e6b8fc6b5af6ca4074766cf","src/parser/features/mod.rs":"6ed075e97af56bff22f22ed1ee83ff6479360e05f9d3661a3145f822c242b694","src/parser/features/suggestions.rs":"79127956b2f1adb9d658925e2779ebebfe9ddea434408762fefb60afdb545f47","src/parser/matches/any_value.rs":"7b6e711fe205e8808394c562dd6a260b56ce350cf9298a308ba9727ab012b664","src/parser/matches/arg_matches.rs":"a24fa086537ef72951821fbf1dc455a04270606ee411685991e79aaae509558c","src/parser/matches/matched_arg.rs":"fb12eb2afaf631bb60aa8c4e42b0f510a877d35a9eaa07a7afd253280c27c251","src/parser/matches/mod.rs":"1467aa752cb1c79d30e4aeaaa55e10a0bb9dcf6f3980496234251431c79c49e6","src/parser/matches/value_source.rs":"e6a477ae36f2f7155960239a97b7d142eef4eb227c41c9eefea147289547d713","src/parser/mod.rs":"358f46d3b7f43dec2563d4c35bd2536fab2491f28e300a9bcdeaf6ca0513ce12","src/parser/parser.rs":"c1339fdf44253b6cbf81fcf71f99bb68300f8d5eb5ab7f0d0d02d222ee63a873","src/parser/validator.rs":"30066cb41ab23800231fb6b028cbce57d118570859659ebc67affbe5226f31f9","src/util/color.rs":"63df5e1cda1001b4c536dc0b04e09dd85dae6d317e34e660abbe3c71e17eaa29","src/util/fnv.rs":"82492d91d990f38b62de8b3c3e67f1fad55919117b1f448aa28acf6d21919fd7","src/util/graph.rs":"f35396b6e2a427377dcbbca69b1b98737d89684a3834cfda98cbf8cc70ff9c2f","src/util/id.rs":"fc498c65887385d92a51359a2f72556c2e508ee49b8cac4b3f827512795d690d","src/util/mod.rs":"8d328a15ef06989d0ce5e65cf3b7ec79c083984b25c0b31ba177bdb22df28a10","src/util/str_to_bool.rs":"1ce90b4939a884eeefc73392722bdfcf906e3070c4398e1557c586c10c684cd0"},"package":"d53da17d37dba964b9b3ecb5c5a1f193a2762c700e6829201e645b9381c99dc7"} \ No newline at end of file
diff --git a/vendor/clap/Cargo.lock b/vendor/clap/Cargo.lock
deleted file mode 100644
index 269dea5ad..000000000
--- a/vendor/clap/Cargo.lock
+++ /dev/null
@@ -1,745 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "addr2line"
-version = "0.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "aho-corasick"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "atty"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi",
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "autocfg"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
-
-[[package]]
-name = "backtrace"
-version = "0.3.65"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bytes"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
-
-[[package]]
-name = "cc"
-version = "1.0.73"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "clap"
-version = "3.2.5"
-dependencies = [
- "atty",
- "backtrace",
- "bitflags",
- "clap_derive",
- "clap_lex",
- "humantime",
- "indexmap",
- "once_cell",
- "regex",
- "rustversion",
- "shlex",
- "snapbox",
- "strsim",
- "termcolor",
- "terminal_size",
- "textwrap",
- "trybuild",
- "trycmd",
- "unicase",
- "yaml-rust",
-]
-
-[[package]]
-name = "clap_derive"
-version = "3.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c11d40217d16aee8508cc8e5fde8b4ff24639758608e5374e731b53f85749fb9"
-dependencies = [
- "heck",
- "proc-macro-error",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "clap_lex"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613"
-dependencies = [
- "os_str_bytes",
-]
-
-[[package]]
-name = "combine"
-version = "4.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948"
-dependencies = [
- "bytes",
- "memchr",
-]
-
-[[package]]
-name = "concolor"
-version = "0.0.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "015267563b1df20adccdd00cb05257b1dfbea70a04928e9cf88ffb850c1a40af"
-dependencies = [
- "atty",
- "bitflags",
- "concolor-query",
-]
-
-[[package]]
-name = "concolor-query"
-version = "0.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6417fe6fc03a8b533fd2177742eeb39a90c7233eedec7bac96d4d6b69a09449"
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c"
-dependencies = [
- "autocfg",
- "cfg-if",
- "crossbeam-utils",
- "lazy_static",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38"
-dependencies = [
- "cfg-if",
- "lazy_static",
-]
-
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
-[[package]]
-name = "escargot"
-version = "0.5.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5584ba17d7ab26a8a7284f13e5bd196294dd2f2d79773cff29b9e9edef601a6"
-dependencies = [
- "log",
- "once_cell",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "gimli"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
-
-[[package]]
-name = "glob"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
-
-[[package]]
-name = "hashbrown"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
-
-[[package]]
-name = "heck"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
-
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "humantime"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
-
-[[package]]
-name = "humantime-serde"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
-dependencies = [
- "humantime",
- "serde",
-]
-
-[[package]]
-name = "indexmap"
-version = "1.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee"
-dependencies = [
- "autocfg",
- "hashbrown",
-]
-
-[[package]]
-name = "itertools"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.125"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
-
-[[package]]
-name = "linked-hash-map"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
-
-[[package]]
-name = "log"
-version = "0.4.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "memchr"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
-
-[[package]]
-name = "memoffset"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "miniz_oxide"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
-dependencies = [
- "adler",
-]
-
-[[package]]
-name = "normalize-line-endings"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
-
-[[package]]
-name = "num_cpus"
-version = "1.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "object"
-version = "0.28.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
-
-[[package]]
-name = "os_pipe"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c92f2b54f081d635c77e7120862d48db8e91f7f21cef23ab1b4fe9971c59f55"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "os_str_bytes"
-version = "6.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
-
-[[package]]
-name = "proc-macro-error"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
-dependencies = [
- "proc-macro-error-attr",
- "proc-macro2",
- "quote",
- "syn",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro-error-attr"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
-dependencies = [
- "proc-macro2",
- "quote",
- "version_check",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1"
-dependencies = [
- "unicode-xid",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "rayon"
-version = "1.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221"
-dependencies = [
- "autocfg",
- "crossbeam-deque",
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4"
-dependencies = [
- "crossbeam-channel",
- "crossbeam-deque",
- "crossbeam-utils",
- "num_cpus",
-]
-
-[[package]]
-name = "regex"
-version = "1.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
-
-[[package]]
-name = "rustversion"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
-
-[[package]]
-name = "ryu"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "serde"
-version = "1.0.137"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.137"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.81"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
-dependencies = [
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "shlex"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
-
-[[package]]
-name = "similar"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3"
-
-[[package]]
-name = "snapbox"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "767a1d5da232b6959cd1bd5c9e8db8a7cce09c3038e89deedb49a549a2aefd93"
-dependencies = [
- "concolor",
- "normalize-line-endings",
- "os_pipe",
- "similar",
- "snapbox-macros",
- "wait-timeout",
- "yansi",
-]
-
-[[package]]
-name = "snapbox-macros"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c01dea7e04cbb27ef4c86e9922184608185f7cd95c1763bc30d727cda4a5e930"
-
-[[package]]
-name = "strsim"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
-
-[[package]]
-name = "syn"
-version = "1.0.92"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ff7c592601f11445996a06f8ad0c27f094a58857c2f89e97974ab9235b92c52"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-xid",
-]
-
-[[package]]
-name = "termcolor"
-version = "1.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "textwrap"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
-dependencies = [
- "terminal_size",
- "unicode-width",
-]
-
-[[package]]
-name = "toml"
-version = "0.5.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "toml_edit"
-version = "0.14.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba98375fd631b83696f87c64e4ed8e29e6a1f3404d6aed95fa95163bad38e705"
-dependencies = [
- "combine",
- "indexmap",
- "itertools",
- "serde",
-]
-
-[[package]]
-name = "trybuild"
-version = "1.0.61"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fc92f558afb6d1d7c6f175eb8d615b8ef49c227543e68e19c123d4ee43d8a7d"
-dependencies = [
- "glob",
- "once_cell",
- "serde",
- "serde_derive",
- "serde_json",
- "termcolor",
- "toml",
-]
-
-[[package]]
-name = "trycmd"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffb4185126cc904642173a54c185083f410c86d1202ada6761aacf7c40829f13"
-dependencies = [
- "escargot",
- "glob",
- "humantime",
- "humantime-serde",
- "rayon",
- "serde",
- "shlex",
- "snapbox",
- "toml_edit",
-]
-
-[[package]]
-name = "unicase"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
-dependencies = [
- "version_check",
-]
-
-[[package]]
-name = "unicode-width"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04"
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
-[[package]]
-name = "wait-timeout"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "yaml-rust"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
-dependencies = [
- "linked-hash-map",
-]
-
-[[package]]
-name = "yansi"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
diff --git a/vendor/clap/Cargo.toml b/vendor/clap/Cargo.toml
deleted file mode 100644
index aba082f3a..000000000
--- a/vendor/clap/Cargo.toml
+++ /dev/null
@@ -1,493 +0,0 @@
-# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
-#
-# When uploading crates to the registry Cargo will automatically
-# "normalize" Cargo.toml files for maximal compatibility
-# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies.
-#
-# If you are reading this file be aware that the original Cargo.toml
-# will likely look very different (and much more reasonable).
-# See Cargo.toml.orig for the original contents.
-
-[package]
-edition = "2021"
-rust-version = "1.56.0"
-name = "clap"
-version = "3.2.5"
-include = [
- "build.rs",
- "src/**/*",
- "Cargo.toml",
- "LICENSE*",
- "README.md",
- "benches/**/*",
- "examples/**/*",
-]
-description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
-documentation = "https://docs.rs/clap/"
-readme = "README.md"
-keywords = [
- "argument",
- "cli",
- "arg",
- "parser",
- "parse",
-]
-categories = ["command-line-interface"]
-license = "MIT OR Apache-2.0"
-repository = "https://github.com/clap-rs/clap"
-resolver = "2"
-
-[package.metadata.docs.rs]
-features = ["unstable-doc"]
-rustdoc-args = [
- "--cfg",
- "docsrs",
-]
-cargo-args = [
- "-Zunstable-options",
- "-Zrustdoc-scrape-examples=examples",
-]
-
-[package.metadata.playground]
-features = ["unstable-doc"]
-
-[package.metadata.release]
-shared-version = true
-tag-name = "v{{version}}"
-
-[[package.metadata.release.pre-release-replacements]]
-file = "CHANGELOG.md"
-search = "Unreleased"
-replace = "{{version}}"
-min = 1
-
-[[package.metadata.release.pre-release-replacements]]
-file = "CHANGELOG.md"
-search = '\.\.\.HEAD'
-replace = "...{{tag_name}}"
-exactly = 1
-
-[[package.metadata.release.pre-release-replacements]]
-file = "CHANGELOG.md"
-search = "ReleaseDate"
-replace = "{{date}}"
-min = 1
-
-[[package.metadata.release.pre-release-replacements]]
-file = "CHANGELOG.md"
-search = "<!-- next-header -->"
-replace = """
-<!-- next-header -->
-## [Unreleased] - ReleaseDate
-"""
-exactly = 1
-
-[[package.metadata.release.pre-release-replacements]]
-file = "CHANGELOG.md"
-search = "<!-- next-url -->"
-replace = """
-<!-- next-url -->
-[Unreleased]: https://github.com/clap-rs/clap/compare/{{tag_name}}...HEAD"""
-exactly = 1
-
-[[package.metadata.release.pre-release-replacements]]
-file = "README.md"
-search = "github.com/clap-rs/clap/blob/[^/]+/"
-replace = "github.com/clap-rs/clap/blob/{{tag_name}}/"
-exactly = 13
-prerelease = true
-
-[[package.metadata.release.pre-release-replacements]]
-file = "README.md"
-search = 'version = "[a-z0-9\.-]+"'
-replace = "version = \"{{version}}\""
-exactly = 1
-prerelease = true
-
-[[package.metadata.release.pre-release-replacements]]
-file = "src/derive.rs"
-search = "github.com/clap-rs/clap/blob/[^/]+/"
-replace = "github.com/clap-rs/clap/blob/{{tag_name}}/"
-exactly = 4
-prerelease = true
-
-[profile.bench]
-lto = true
-codegen-units = 1
-
-[profile.test]
-opt-level = 1
-
-[lib]
-bench = false
-
-[[example]]
-name = "demo"
-required-features = ["derive"]
-
-[[example]]
-name = "cargo-example"
-required-features = ["cargo"]
-
-[[example]]
-name = "cargo-example-derive"
-required-features = ["derive"]
-
-[[example]]
-name = "escaped-positional"
-required-features = ["cargo"]
-
-[[example]]
-name = "escaped-positional-derive"
-required-features = ["derive"]
-
-[[example]]
-name = "git-derive"
-required-features = ["derive"]
-
-[[example]]
-name = "typed-derive"
-required-features = ["derive"]
-
-[[example]]
-name = "busybox"
-path = "examples/multicall-busybox.rs"
-
-[[example]]
-name = "hostname"
-path = "examples/multicall-hostname.rs"
-
-[[example]]
-name = "repl"
-path = "examples/repl.rs"
-
-[[example]]
-name = "01_quick"
-path = "examples/tutorial_builder/01_quick.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "02_apps"
-path = "examples/tutorial_builder/02_apps.rs"
-
-[[example]]
-name = "02_crate"
-path = "examples/tutorial_builder/02_crate.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "02_app_settings"
-path = "examples/tutorial_builder/02_app_settings.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "03_01_flag_bool"
-path = "examples/tutorial_builder/03_01_flag_bool.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "03_01_flag_count"
-path = "examples/tutorial_builder/03_01_flag_count.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "03_02_option"
-path = "examples/tutorial_builder/03_02_option.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "03_03_positional"
-path = "examples/tutorial_builder/03_03_positional.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "03_04_subcommands"
-path = "examples/tutorial_builder/03_04_subcommands.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "03_05_default_values"
-path = "examples/tutorial_builder/03_05_default_values.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "04_01_possible"
-path = "examples/tutorial_builder/04_01_possible.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "04_01_enum"
-path = "examples/tutorial_builder/04_01_enum.rs"
-required-features = [
- "cargo",
- "derive",
-]
-
-[[example]]
-name = "04_02_parse"
-path = "examples/tutorial_builder/04_02_parse.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "04_02_validate"
-path = "examples/tutorial_builder/04_02_validate.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "04_03_relations"
-path = "examples/tutorial_builder/04_03_relations.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "04_04_custom"
-path = "examples/tutorial_builder/04_04_custom.rs"
-required-features = ["cargo"]
-
-[[example]]
-name = "05_01_assert"
-path = "examples/tutorial_builder/05_01_assert.rs"
-test = true
-required-features = ["cargo"]
-
-[[example]]
-name = "01_quick_derive"
-path = "examples/tutorial_derive/01_quick.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "02_apps_derive"
-path = "examples/tutorial_derive/02_apps.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "02_crate_derive"
-path = "examples/tutorial_derive/02_crate.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "02_app_settings_derive"
-path = "examples/tutorial_derive/02_app_settings.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_01_flag_bool_derive"
-path = "examples/tutorial_derive/03_01_flag_bool.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_01_flag_count_derive"
-path = "examples/tutorial_derive/03_01_flag_count.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_02_option_derive"
-path = "examples/tutorial_derive/03_02_option.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_03_positional_derive"
-path = "examples/tutorial_derive/03_03_positional.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_04_subcommands_derive"
-path = "examples/tutorial_derive/03_04_subcommands.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_04_subcommands_alt_derive"
-path = "examples/tutorial_derive/03_04_subcommands_alt.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "03_05_default_values_derive"
-path = "examples/tutorial_derive/03_05_default_values.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "04_01_enum_derive"
-path = "examples/tutorial_derive/04_01_enum.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "04_02_parse_derive"
-path = "examples/tutorial_derive/04_02_parse.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "04_02_validate_derive"
-path = "examples/tutorial_derive/04_02_validate.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "04_03_relations_derive"
-path = "examples/tutorial_derive/04_03_relations.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "04_04_custom_derive"
-path = "examples/tutorial_derive/04_04_custom.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "05_01_assert_derive"
-path = "examples/tutorial_derive/05_01_assert.rs"
-test = true
-required-features = ["derive"]
-
-[[example]]
-name = "custom-bool"
-path = "examples/derive_ref/custom-bool.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "interop_augment_args"
-path = "examples/derive_ref/augment_args.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "interop_augment_subcommands"
-path = "examples/derive_ref/augment_subcommands.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "interop_hand_subcommand"
-path = "examples/derive_ref/hand_subcommand.rs"
-required-features = ["derive"]
-
-[[example]]
-name = "interop_flatten_hand_args"
-path = "examples/derive_ref/flatten_hand_args.rs"
-required-features = ["derive"]
-
-[dependencies.atty]
-version = "0.2"
-optional = true
-
-[dependencies.backtrace]
-version = "0.3"
-optional = true
-
-[dependencies.bitflags]
-version = "1.2"
-
-[dependencies.clap_derive]
-version = "=3.2.5"
-optional = true
-
-[dependencies.clap_lex]
-version = "0.2.2"
-
-[dependencies.indexmap]
-version = "1.0"
-
-[dependencies.once_cell]
-version = "1.12.0"
-optional = true
-
-[dependencies.regex]
-version = "1.0"
-optional = true
-
-[dependencies.strsim]
-version = "0.10"
-optional = true
-
-[dependencies.termcolor]
-version = "1.1.1"
-optional = true
-
-[dependencies.terminal_size]
-version = "0.1.12"
-optional = true
-
-[dependencies.textwrap]
-version = "0.15.0"
-features = []
-default-features = false
-
-[dependencies.unicase]
-version = "2.6"
-optional = true
-
-[dependencies.yaml-rust]
-version = "0.4.1"
-optional = true
-
-[dev-dependencies.humantime]
-version = "2"
-
-[dev-dependencies.regex]
-version = "1.0"
-
-[dev-dependencies.rustversion]
-version = "1"
-
-[dev-dependencies.shlex]
-version = "1.1.0"
-
-[dev-dependencies.snapbox]
-version = "0.2.9"
-
-[dev-dependencies.trybuild]
-version = "1.0.18"
-
-[dev-dependencies.trycmd]
-version = "0.13"
-features = [
- "color-auto",
- "diff",
- "examples",
-]
-default-features = false
-
-[features]
-cargo = ["once_cell"]
-color = [
- "atty",
- "termcolor",
-]
-debug = [
- "clap_derive/debug",
- "backtrace",
-]
-default = [
- "std",
- "color",
- "suggestions",
-]
-deprecated = ["clap_derive/deprecated"]
-derive = [
- "clap_derive",
- "once_cell",
-]
-env = []
-std = ["indexmap/std"]
-suggestions = ["strsim"]
-unicode = [
- "textwrap/unicode-width",
- "unicase",
-]
-unstable-doc = [
- "derive",
- "cargo",
- "wrap_help",
- "yaml",
- "env",
- "unicode",
- "regex",
- "unstable-replace",
- "unstable-grouped",
-]
-unstable-grouped = []
-unstable-replace = []
-unstable-v4 = [
- "clap_derive/unstable-v4",
- "deprecated",
-]
-wrap_help = [
- "terminal_size",
- "textwrap/terminal_size",
-]
-yaml = ["yaml-rust"]
diff --git a/vendor/clap/README.md b/vendor/clap/README.md
deleted file mode 100644
index 48b7a3cbd..000000000
--- a/vendor/clap/README.md
+++ /dev/null
@@ -1,179 +0,0 @@
-<!-- omit in TOC -->
-# clap
-
-> **Command Line Argument Parser for Rust**
-
-[![Crates.io](https://img.shields.io/crates/v/clap?style=flat-square)](https://crates.io/crates/clap)
-[![Crates.io](https://img.shields.io/crates/d/clap?style=flat-square)](https://crates.io/crates/clap)
-[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/v3.2.5/LICENSE-APACHE)
-[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/v3.2.5/LICENSE-MIT)
-[![Build Status](https://img.shields.io/github/workflow/status/clap-rs/clap/CI/staging?style=flat-square)](https://github.com/clap-rs/clap/actions/workflows/ci.yml?query=branch%3Astaging)
-[![Coverage Status](https://img.shields.io/coveralls/github/clap-rs/clap/master?style=flat-square)](https://coveralls.io/github/clap-rs/clap?branch=master)
-[![Contributors](https://img.shields.io/github/contributors/clap-rs/clap?style=flat-square)](https://github.com/clap-rs/clap/graphs/contributors)
-
-Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT).
-
-1. [About](#about)
-2. Tutorial: [Builder API](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_builder/README.md), [Derive API](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_derive/README.md)
-3. [Examples](https://github.com/clap-rs/clap/blob/v3.2.5/examples/README.md)
-4. [API Reference](https://docs.rs/clap)
- - [Derive Reference](https://github.com/clap-rs/clap/blob/v3.2.5/examples/derive_ref/README.md)
- - [Feature Flags](#feature-flags)
-5. [CHANGELOG](https://github.com/clap-rs/clap/blob/v3.2.5/CHANGELOG.md)
-6. [FAQ](https://github.com/clap-rs/clap/blob/v3.2.5/docs/FAQ.md)
-7. [Questions & Discussions](https://github.com/clap-rs/clap/discussions)
-8. [Contributing](https://github.com/clap-rs/clap/blob/v3.2.5/CONTRIBUTING.md)
-8. [Sponsors](#sponsors)
-
-## About
-
-Create your command-line parser, with all of the bells and whistles, declaratively or procedurally.
-
-### Example
-
-This uses our
-[Derive API](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_derive/README.md)
-which provides access to the [Builder API](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_builder/README.md) as attributes on a `struct`:
-
-<!-- Copied from examples/demo.{rs,md} -->
-```rust,no_run
-use clap::Parser;
-
-/// Simple program to greet a person
-#[derive(Parser, Debug)]
-#[clap(author, version, about, long_about = None)]
-struct Args {
- /// Name of the person to greet
- #[clap(short, long, value_parser)]
- name: String,
-
- /// Number of times to greet
- #[clap(short, long, value_parser, default_value_t = 1)]
- count: u8,
-}
-
-fn main() {
- let args = Args::parse();
-
- for _ in 0..args.count {
- println!("Hello {}!", args.name)
- }
-}
-```
-Add this to `Cargo.toml`:
-```toml
-[dependencies]
-clap = { version = "3.2.5", features = ["derive"] }
-```
-```bash
-$ demo --help
-clap [..]
-Simple program to greet a person
-
-USAGE:
- demo[EXE] [OPTIONS] --name <NAME>
-
-OPTIONS:
- -c, --count <COUNT> Number of times to greet [default: 1]
- -h, --help Print help information
- -n, --name <NAME> Name of the person to greet
- -V, --version Print version information
-```
-*(version number and `.exe` extension on windows replaced by placeholders)*
-
-### Aspirations
-
-- Out of the box, users get a polished CLI experience
- - Including common argument behavior, help generation, suggested fixes for users, colored output, [shell completions](https://github.com/clap-rs/clap/tree/master/clap_complete), etc
-- Flexible enough to port your existing CLI interface
- - However, we won't necessarily streamline support for each use case
-- Reasonable parse performance
-- Resilient maintainership, including
- - Willing to break compatibility rather than batching up breaking changes in large releases
- - Leverage feature flags to keep to one active branch
- - Being under [WG-CLI](https://github.com/rust-cli/team/) to increase the bus factor
-- We follow semver and will wait about 6-9 months between major breaking changes
-- We will support the last two minor Rust releases (MSRV, currently 1.56.0)
-
-While these aspirations can be at odds with fast build times and low binary
-size, we will still strive to keep these reasonable for the flexibility you
-get. Check out the
-[argparse-benchmarks](https://github.com/rust-cli/argparse-benchmarks-rs) for
-CLI parsers optimized for other use cases.
-
-### Selecting an API
-
-Why use the declarative [Derive API](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_derive/README.md):
-- Easier to read, write, and modify
-- Easier to keep the argument declaration and reading of argument in sync
-- Easier to reuse, e.g. [clap-verbosity-flag](https://crates.io/crates/clap-verbosity-flag)
-
-Why use the procedural [Builder API](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_builder/README.md):
-- Faster compile times if you aren't already using other procedural macros
-- More flexible, e.g. you can look up how many times an argument showed up,
- what its values were, and what were the indexes of those values. The Derive
- API can only report presence, number of occurrences, or values but no indices
- or combinations of data.
-
-### Related Projects
-
-- [wild](https://crates.io/crates/wild) for supporting wildcards (`*`) on Windows like you do Linux
-- [argfile](https://crates.io/crates/argfile) for loading additional arguments from a file (aka response files)
-- [shadow-rs](https://crates.io/crates/shadow-rs) for generating `Command::long_version`
-- [clap_lex](https://crates.io/crates/clap_lex) for a lighter-weight, battle-tested CLI parser
-- [clap_mangen](https://crates.io/crates/clap_mangen) for generating man page source (roff)
-- [clap_complete](https://crates.io/crates/clap_complete) for shell completion support
-- [clap-verbosity-flag](https://crates.io/crates/clap-verbosity-flag)
-- [clap-cargo](https://crates.io/crates/clap-cargo)
-- [concolor-clap](https://crates.io/crates/concolor-clap)
-- [Command-line Apps for Rust](https://rust-cli.github.io/book/index.html) book
-- [`trycmd`](https://crates.io/crates/trycmd): Snapshot testing
- - Or for more control, [`assert_cmd`](https://crates.io/crates/assert_cmd) and [`assert_fs`](https://crates.io/crates/assert_fs)
-
-## Feature Flags
-
-### Default Features
-
-* **std**: _Not Currently Used._ Placeholder for supporting `no_std` environments in a backwards compatible manner.
-* **color**: Turns on colored error messages.
-* **suggestions**: Turns on the `Did you mean '--myoption'?` feature for when users make typos.
-
-#### Optional features
-
-* **deprecated**: Guided experience to prepare for next breaking release (at different stages of development, this may become default)
-* **derive**: Enables the custom derive (i.e. `#[derive(Parser)]`). Without this you must use one of the other methods of creating a `clap` CLI listed above.
-* **cargo**: Turns on macros that read values from `CARGO_*` environment variables.
-* **env**: Turns on the usage of environment variables during parsing.
-* **regex**: Enables regex validators.
-* **unicode**: Turns on support for unicode characters (including emoji) in arguments and help messages.
-* **wrap_help**: Turns on the help text wrapping feature, based on the terminal size.
-
-#### Experimental features
-
-**Warning:** These may contain breaking changes between minor releases.
-
-* **unstable-replace**: Enable [`Command::replace`](https://github.com/clap-rs/clap/issues/2836)
-* **unstable-grouped**: Enable [`ArgMatches::grouped_values_of`](https://github.com/clap-rs/clap/issues/2924)
-* **unstable-v4**: Preview features which will be stable on the v4.0 release
-
-## Sponsors
-
-<!-- omit in TOC -->
-### Gold
-
-[![](https://opencollective.com/clap/tiers/gold.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
-
-<!-- omit in TOC -->
-### Silver
-
-[![](https://opencollective.com/clap/tiers/silver.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
-
-<!-- omit in TOC -->
-### Bronze
-
-[![](https://opencollective.com/clap/tiers/bronze.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
-
-<!-- omit in TOC -->
-### Backer
-
-[![](https://opencollective.com/clap/tiers/backer.svg?avatarHeight=36&width=600)](https://opencollective.com/clap)
diff --git a/vendor/clap/examples/README.md b/vendor/clap/examples/README.md
deleted file mode 100644
index 2034ab80e..000000000
--- a/vendor/clap/examples/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Examples
-
-- Basic demo: [derive](demo.md)
-- Typed arguments: [derive](typed-derive.md)
- - Topics:
- - Custom `parse()`
-- Custom cargo command: [builder](cargo-example.md), [derive](cargo-example-derive.md)
- - Topics:
- - Subcommands
- - Cargo plugins
-- git-like interface: [builder](git.md), [derive](git-derive.md)
- - Topics:
- - Subcommands
- - External subcommands
- - Optional subcommands
- - Default subcommands
-- pacman-like interface: [builder](pacman.md)
- - Topics:
- - Flag subcommands
- - Conflicting arguments
-- Escaped positionals with `--`: [builder](escaped-positional.md), [derive](escaped-positional-derive.md)
-- Multi-call
- - busybox: [builder](multicall-busybox.md)
- - Topics:
- - Subcommands
- - hostname: [builder](multicall-hostname.md)
- - Topics:
- - Subcommands
-- repl: [builder](repl.rs)
- - Topics:
- - Read-Eval-Print Loops / Custom command lines
-
-## Contributing
-
-New examples:
-- Building: They must be added to [Cargo.toml](../Cargo.toml) with the appropriate `required-features`.
-- Testing: Ensure there is a markdown file with [trycmd](https://docs.rs/trycmd) syntax
-- Link the `.md` file from here
-
-See also the general [CONTRIBUTING](../CONTRIBUTING.md).
diff --git a/vendor/clap/examples/derive_ref/README.md b/vendor/clap/examples/derive_ref/README.md
deleted file mode 100644
index a3b0c084d..000000000
--- a/vendor/clap/examples/derive_ref/README.md
+++ /dev/null
@@ -1,440 +0,0 @@
-# Derive Reference
-
-1. [Overview](#overview)
-2. [Attributes](#attributes)
- 1. [Terminology](#terminology)
- 2. [Command Attributes](#command-attributes)
- 3. [Arg Attributes](#arg-attributes)
- 4. [Arg Enum Attributes](#arg-enum-attributes)
- 5. [Possible Value Attributes](#possible-value-attributes)
-3. [Arg Types](#arg-types)
-4. [Doc Comments](#doc-comments)
-5. [Tips](#tips)
-6. [Mixing Builder and Derive APIS](#mixing-builder-and-derive-apis)
-
-## Overview
-
-To derive `clap` types, you need to enable the `derive` feature flag.
-
-See [demo.rs](../demo.rs) and [demo.md](../demo.md) for a brief example.
-
-Let's start by breaking down the anatomy of the derive attributes:
-```rust
-use clap::{Parser, Args, Subcommand, ValueEnum};
-
-/// Doc comment
-#[derive(Parser)]
-#[clap(APP ATTRIBUTE)]
-struct Cli {
- /// Doc comment
- #[clap(ARG ATTRIBUTE)]
- field: UserType,
-
- #[clap(value_enum, ARG ATTRIBUTE...)]
- field: EnumValues,
-
- #[clap(flatten)]
- delegate: Struct,
-
- #[clap(subcommand)]
- command: Command,
-}
-
-/// Doc comment
-#[derive(Args)]
-#[clap(PARENT APP ATTRIBUTE)]
-struct Struct {
- /// Doc comment
- #[clap(ARG ATTRIBUTE)]
- field: UserType,
-}
-
-/// Doc comment
-#[derive(Subcommand)]
-#[clap(PARENT APP ATTRIBUTE)]
-enum Command {
- /// Doc comment
- #[clap(APP ATTRIBUTE)]
- Variant1(Struct),
-
- /// Doc comment
- #[clap(APP ATTRIBUTE)]
- Variant2 {
- /// Doc comment
- #[clap(ARG ATTRIBUTE)]
- field: UserType,
- }
-}
-
-/// Doc comment
-#[derive(ValueEnum)]
-#[clap(ARG ENUM ATTRIBUTE)]
-enum EnumValues {
- /// Doc comment
- #[clap(POSSIBLE VALUE ATTRIBUTE)]
- Variant1,
-}
-
-fn main() {
- let cli = Cli::parse();
-}
-```
-
-- `Parser` parses arguments into a `struct` (arguments) or `enum` (subcommands).
-- `Args` allows defining a set of re-usable arguments that get merged into their parent container.
-- `Subcommand` defines available subcommands.
- - Subcommand arguments can be defined in a struct-variant or automatically flattened with a tuple-variant.
-- `ValueEnum` allows parsing a value directly into an `enum`, erroring on unsupported values.
- - The derive doesn't work on enums that contain non-unit variants, unless they are skipped
-
-See also the [tutorial](../tutorial_derive/README.md) and [examples](../README.md).
-
-## Attributes
-
-### Terminology
-
-**Raw attributes** are forwarded directly to the underlying `clap` builder. Any
-`Command`, `Arg`, or `PossibleValue` method can be used as an attribute.
-
-Raw attributes come in two different syntaxes:
-```rust
-#[clap(
- global = true, // name = arg form, neat for one-arg methods
- required_if_eq("out", "file") // name(arg1, arg2, ...) form.
-)]
-```
-
-- `method = arg` can only be used for methods which take only one argument.
-- `method(arg1, arg2)` can be used with any method.
-
-As long as `method_name` is not one of the magical methods - it will be
-translated into a mere method call.
-
-**Magic attributes** have post-processing done to them, whether that is
-- Providing of defaults
-- Special behavior is triggered off of it
-
-Magic attributes are more constrained in the syntax they support, usually just
-`<attr> = <value>` though some use `<attr>(<value>)` instead. See the specific
-magic attributes documentation for details. This allows users to access the
-raw behavior of an attribute via `<attr>(<value>)` syntax.
-
-**NOTE:** Some attributes are inferred from [Arg Types](#arg-types) and [Doc
-Comments](#doc-comments). Explicit attributes take precedence over inferred
-attributes.
-
-### Command Attributes
-
-These correspond to a `clap::Command` which is used for both top-level parsers and
-when defining subcommands.
-
-**Raw attributes:** Any [`Command` method](https://docs.rs/clap/latest/clap/type.Command.html) can also be used as an attribute, see [Terminology](#terminology) for syntax.
-- e.g. `#[clap(arg_required_else_help(true))]` would translate to `cmd.arg_required_else_help(true)`
-
-**Magic attributes:**
-- `name = <expr>`: `clap::Command::name`
- - When not present: [crate `name`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-name-field) (`Parser` container), variant name (`Subcommand` variant)
-- `version [= <expr>]`: `clap::Command::version`
- - When not present: no version set
- - Without `<expr>`: defaults to [crate `version`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field)
-- `author [= <expr>]`: `clap::Command::author`
- - When not present: no author set
- - Without `<expr>`: defaults to [crate `authors`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-authors-field)
-- `about [= <expr>]`: `clap::Command::about`
- - When not present: [Doc comment summary](#doc-comments)
- - Without `<expr>`: [crate `description`](https://doc.rust-lang.org/cargo/reference/manifest.html#the-description-field) (`Parser` container)
- - **TIP:** When a doc comment is also present, you most likely want to add
- `#[clap(long_about = None)]` to clear the doc comment so only `about`
- gets shown with both `-h` and `--help`.
-- `long_about = <expr>`: `clap::Command::long_about`
- - When not present: [Doc comment](#doc-comments) if there is a blank line, else nothing
-- `verbatim_doc_comment`: Minimizes pre-processing when converting doc comments to `about` / `long_about`
-- `next_display_order`: `clap::Command::next_display_order`
-- `next_help_heading`: `clap::Command::next_help_heading`
- - When `flatten`ing `Args`, this is scoped to just the args in this struct and any struct `flatten`ed into it
-- `rename_all = <expr>`: Override default field / variant name case conversion for `Command::name` / `Arg::name`
- - When not present: `kebab-case`
- - Available values: `camelCase`, `kebab-case`, `PascalCase`, `SCREAMING_SNAKE_CASE`, `snake_case`, `lower`, `UPPER`, `verbatim`
-- `rename_all_env = <expr>`: Override default field name case conversion for env variables for `clap::Arg::env`
- - When not present: `SCREAMING_SNAKE_CASE`
- - Available values: `camelCase`, `kebab-case`, `PascalCase`, `SCREAMING_SNAKE_CASE`, `snake_case`, `lower`, `UPPER`, `verbatim`
-
-And for `Subcommand` variants:
-- `skip`: Ignore this variant
-- `flatten`: Delegates to the variant for more subcommands (must implement `Subcommand`)
-- `subcommand`: Nest subcommands under the current set of subcommands (must implement `Subcommand`)
-- `external_subcommand`: `clap::Command::allow_external_subcommand(true)`
- - Variant must be either `Variant(Vec<String>)` or `Variant(Vec<OsString>)`
-
-### Arg Attributes
-
-These correspond to a `clap::Arg`.
-
-**Raw attributes:** Any [`Arg` method](https://docs.rs/clap/latest/clap/struct.Arg.html) can also be used as an attribute, see [Terminology](#terminology) for syntax.
-- e.g. `#[clap(max_values(3))]` would translate to `arg.max_values(3)`
-
-**Magic attributes**:
-- `name = <expr>`: `clap::Arg::new`
- - When not present: case-converted field name is used
-- `value_parser [= <expr>]`: `clap::Arg::value_parser`
- - When not present: will auto-select an implementation based on the field type
- - To register a custom type's `ValueParser`, implement `ValueParserFactory`
- - When present, implies `#[clap(action)]`
-- `action [= <expr>]`: `clap::Arg::action`
- - When not present: will auto-select an action based on the field type
- - When present, implies `#[clap(value_parser)]`
-- `help = <expr>`: `clap::Arg::help`
- - When not present: [Doc comment summary](#doc-comments)
-- `long_help = <expr>`: `clap::Arg::long_help`
- - When not present: [Doc comment](#doc-comments) if there is a blank line, else nothing
-- `verbatim_doc_comment`: Minimizes pre-processing when converting doc comments to `help` / `long_help`
-- `short [= <char>]`: `clap::Arg::short`
- - When not present: no short set
- - Without `<char>`: defaults to first character in the case-converted field name
-- `long [= <str>]`: `clap::Arg::long`
- - When not present: no long set
- - Without `<str>`: defaults to the case-converted field name
-- `env [= <str>]`: `clap::Arg::env` (needs `env` feature enabled)
- - When not present: no env set
- - Without `<str>`: defaults to the case-converted field name
-- `flatten`: Delegates to the field for more arguments (must implement `Args`)
- - Only `help_heading` can be used with `flatten`. See
- [clap-rs/clap#3269](https://github.com/clap-rs/clap/issues/3269) for why
- arg attributes are not generally supported.
- - **Tip:** Though we do apply a flattened `Args`'s Parent Command Attributes, this
- makes reuse harder. Generally prefer putting the cmd attributes on the `Parser`
- or on the flattened field.
-- `subcommand`: Delegates definition of subcommands to the field (must implement `Subcommand`)
- - When `Option<T>`, the subcommand becomes optional
-- `from_global`: Read a `clap::Arg::global` argument (raw attribute), regardless of what subcommand you are in
-- `parse(<kind> [= <function>])`: `clap::Arg::validator` and `clap::ArgMatches::values_of_t`
- - **Deprecated:**
- - Use `value_parser(...)` for `from_str`, `try_from_str`, `from_os_str`, and `try_from_os_str`
- - Use `action(ArgAction::Count` for `from_occurrences`
- - Use `action(ArgAction::SetTrue` for `from_flag`
- - Default: `try_from_str`
- - Warning: for `Path` / `OsString`, be sure to use `try_from_os_str`
- - See [Arg Types](#arg-types) for more details
-- `value_enum`: Parse the value using the `ValueEnum` trait
-- `skip [= <expr>]`: Ignore this field, filling in with `<expr>`
- - Without `<expr>`: fills the field with `Default::default()`
-- `default_value = <str>`: `clap::Arg::default_value` and `clap::Arg::required(false)`
-- `default_value_t [= <expr>]`: `clap::Arg::default_value` and `clap::Arg::required(false)`
- - Requires `std::fmt::Display` or `#[clap(value_enum)]`
- - Without `<expr>`, relies on `Default::default()`
-- `default_value_os_t [= <expr>]`: `clap::Arg::default_value_os` and `clap::Arg::required(false)`
- - Requires `std::convert::Into<OsString>` or `#[clap(value_enum)]`
- - Without `<expr>`, relies on `Default::default()`
-
-### Arg Enum Attributes
-
-- `rename_all = <expr>`: Override default field / variant name case conversion for `PossibleValue::new`
- - When not present: `kebab-case`
- - Available values: `camelCase`, `kebab-case`, `PascalCase`, `SCREAMING_SNAKE_CASE`, `snake_case`, `lower`, `UPPER`, `verbatim`
-
-### Possible Value Attributes
-
-These correspond to a `clap::PossibleValue`.
-
-**Raw attributes:** Any [`PossibleValue` method](https://docs.rs/clap/latest/clap/struct.PossibleValue.html) can also be used as an attribute, see [Terminology](#terminology) for syntax.
-- e.g. `#[clap(alias("foo"))]` would translate to `pv.alias("foo")`
-
-**Magic attributes**:
-- `name = <expr>`: `clap::PossibleValue::new`
- - When not present: case-converted field name is used
-- `help = <expr>`: `clap::PossibleValue::help`
- - When not present: [Doc comment summary](#doc-comments)
-
-## Arg Types
-
-`clap` assumes some intent based on the type used:
-
-| Type | Effect | Implies |
-|---------------------|--------------------------------------|------------------------------------------------------------------|
-| `bool` | flag | `#[clap(parse(from_flag))]` |
-| `Option<T>` | optional argument | `.takes_value(true).required(false)` |
-| `Option<Option<T>>` | optional value for optional argument | `.takes_value(true).required(false).min_values(0).max_values(1)` |
-| `T` | required argument | `.takes_value(true).required(!has_default)` |
-| `Vec<T>` | `0..` occurrences of argument | `.takes_value(true).required(false).multiple_occurrences(true)` |
-| `Option<Vec<T>>` | `0..` occurrences of argument | `.takes_value(true).required(false).multiple_occurrences(true)` |
-
-Notes:
-- For custom type behavior, you can override the implied attributes/settings and/or set additional ones
- - For example, see [custom-bool](./custom-bool.md)
-- `Option<Vec<T>>` will be `None` instead of `vec![]` if no arguments are provided.
- - This gives the user some flexibility in designing their argument, like with `min_values(0)`
-
-You can then support your custom type with `#[clap(parse(<kind> [= <function>]))]`:
-
-| `<kind>` | Signature | Default `<function>` |
-|--------------------------|---------------------------------------|---------------------------------|
-| `from_str` | `fn(&str) -> T` | `::std::convert::From::from` |
-| `try_from_str` (default) | `fn(&str) -> Result<T, E>` | `::std::str::FromStr::from_str` |
-| `from_os_str` | `fn(&OsStr) -> T` | `::std::convert::From::from` |
-| `try_from_os_str` | `fn(&OsStr) -> Result<T, E>` | (no default function) |
-| `from_occurrences` | `fn(u64) -> T` | `value as T` |
-| `from_flag` | `fn(bool) -> T` | `::std::convert::From::from` |
-
-Notes:
-- `from_os_str`:
- - Implies `arg.takes_value(true).allow_invalid_utf8(true)`
-- `try_from_os_str`:
- - Implies `arg.takes_value(true).allow_invalid_utf8(true)`
-- `from_occurrences`:
- - Implies `arg.takes_value(false).multiple_occurrences(true)`
- - Reads from `clap::ArgMatches::occurrences_of` rather than a `get_one` function
- - Note: operations on values, like `default_value`, are unlikely to do what you want
-- `from_flag`
- - Implies `arg.takes_value(false)`
- - Reads from `clap::ArgMatches::is_present` rather than a `get_one` function
- - Note: operations on values, like `default_value`, are unlikely to do what you want
-
-**Warning:**
-- To support non-UTF8 paths, you should use `#[clap(value_parser)]` otherwise
- `clap` will parse it as a `String` which will fail on some paths.
-
-## Doc Comments
-
-In clap, help messages for the whole binary can be specified
-via [`Command::about`] and [`Command::long_about`] while help messages
-for individual arguments can be specified via [`Arg::help`] and [`Arg::long_help`]".
-
-`long_*` variants are used when user calls the program with
-`--help` and "short" variants are used with `-h` flag.
-
-```rust
-# use clap::Parser;
-
-#[derive(Parser)]
-#[clap(about = "I am a program and I work, just pass `-h`", long_about = None)]
-struct Foo {
- #[clap(short, help = "Pass `-h` and you'll see me!")]
- bar: String,
-}
-```
-
-For convenience, doc comments can be used instead of raw methods
-(this example works exactly like the one above):
-
-```rust
-# use clap::Parser;
-
-#[derive(Parser)]
-/// I am a program and I work, just pass `-h`
-struct Foo {
- /// Pass `-h` and you'll see me!
- bar: String,
-}
-```
-
-**NOTE:** Attributes have priority over doc comments!
-
-**Top level doc comments always generate `Command::about/long_about` calls!**
-If you really want to use the `Command::about/long_about` methods (you likely don't),
-use the `about` / `long_about` attributes to override the calls generated from
-the doc comment. To clear `long_about`, you can use
-`#[clap(long_about = None)]`.
-
-**TIP:** Set `#![deny(missing_docs)]` to catch missing `--help` documentation at compile time.
-
-### Pre-processing
-
-```rust
-# use clap::Parser;
-#[derive(Parser)]
-/// Hi there, I'm Robo!
-///
-/// I like beeping, stumbling, eating your electricity,
-/// and making records of you singing in a shower.
-/// Pay up, or I'll upload it to youtube!
-struct Robo {
- /// Call my brother SkyNet.
- ///
- /// I am artificial superintelligence. I won't rest
- /// until I'll have destroyed humanity. Enjoy your
- /// pathetic existence, you mere mortals.
- #[clap(long, action)]
- kill_all_humans: bool,
-}
-```
-
-A doc comment consists of three parts:
-- Short summary
-- A blank line (whitespace only)
-- Detailed description, all the rest
-
-The summary corresponds with `Command::about` / `Arg::help`. When a blank line is
-present, the whole doc comment will be passed to `Command::long_about` /
-`Arg::long_help`. Or in other words, a doc may result in just a `Command::about` /
-`Arg::help` or `Command::about` / `Arg::help` and `Command::long_about` /
-`Arg::long_help`
-
-In addition, when `verbatim_doc_comment` is not present, `clap` applies some preprocessing, including:
-
-- Strip leading and trailing whitespace from every line, if present.
-
-- Strip leading and trailing blank lines, if present.
-
-- Interpret each group of non-empty lines as a word-wrapped paragraph.
-
- We replace newlines within paragraphs with spaces to allow the output
- to be re-wrapped to the terminal width.
-
-- Strip any excess blank lines so that there is exactly one per paragraph break.
-
-- If the first paragraph ends in exactly one period,
- remove the trailing period (i.e. strip trailing periods but not trailing ellipses).
-
-Sometimes you don't want this preprocessing to apply, for example the comment contains
-some ASCII art or markdown tables, you would need to preserve LFs along with
-blank lines and the leading/trailing whitespace. When you pass use the
-`verbatim_doc_comment` magic attribute, you preserve
-them.
-
-**Note:** Keep in mind that `verbatim_doc_comment` will *still*
-- Remove one leading space from each line, even if this attribute is present,
- to allow for a space between `///` and the content.
-- Remove leading and trailing blank lines
-
-## Tips
-
-- To get access to a `Command` call `CommandFactory::command` (implemented when deriving `Parser`)
-- Proactively check for bad `Command` configurations by calling `Command::debug_assert` in a test ([example](../tutorial_derive/05_01_assert.rs))
-
-## Mixing Builder and Derive APIs
-
-The builder and derive APIs do not live in isolation. They can work together, which is especially helpful if some arguments can be specified at compile-time while others must be specified at runtime.
-
-### Using derived arguments in a builder application
-
-*[Jump to source](augment_args.rs)*
-
-When using the derive API, you can `#[clap(flatten)]` a struct deriving `Args` into a struct deriving `Args` or `Parser`. This example shows how you can augment a `Command` instance created using the builder API with `Args` created using the derive API.
-
-It uses the `Args::augment_args` method to add the arguments to the `Command` instance.
-
-Crates such as [clap-verbosity-flag](https://github.com/rust-cli/clap-verbosity-flag) provide structs that implement `Args` or `Parser`. Without the technique shown in this example, it would not be possible to use such crates with the builder API. `augment_args` to the rescue!
-
-### Using derived subcommands in a builder application
-
-*[Jump to source](augment_subcommands.rs)*
-
-When using the derive API, you can use `#[clap(subcommand)]` inside the struct to add subcommands. The type of the field is usually an enum that derived `Parser`. However, you can also add the subcommands in that enum to a `Command` instance created with the builder API.
-
-It uses the `Subcommand::augment_subcommands` method to add the subcommands to the `Command` instance.
-
-### Adding hand-implemented subcommands to a derived application
-
-*[Jump to source](hand_subcommand.rs)*
-
-When using the derive API, you can use `#[clap(subcommand)]` inside the struct to add subcommands. The type of the field is usually an enum that derived `Parser`. However, you can also implement the `Subcommand` trait manually on this enum (or any other type) and it can still be used inside the struct created with the derive API. The implementation of the `Subcommand` trait will use the builder API to add the subcommands to the `Command` instance created behind the scenes for you by the derive API.
-
-Notice how in the previous example we used `augment_subcommands` on an enum that derived `Parser`, whereas now we implement `augment_subcommands` ourselves, but the derive API calls it automatically since we used the `#[clap(subcommand)]` attribute.
-
-### Flattening hand-implemented args into a derived application
-
-*[Jump to source](flatten_hand_args.rs)*
-
-When using the derive API, you can use `#[clap(flatten)]` inside the struct to add arguments as if they were added directly to the containing struct. The type of the field is usually an struct that derived `Args`. However, you can also implement the `Args` trait manually on this struct (or any other type) and it can still be used inside the struct created with the derive API. The implementation of the `Args` trait will use the builder API to add the arguments to the `Command` instance created behind the scenes for you by the derive API.
-
-Notice how in the example 1 we used `augment_args` on the struct that derived `Parser`, whereas now we implement `augment_args` ourselves, but the derive API calls it automatically since we used the `#[clap(flatten)]` attribute.
diff --git a/vendor/clap/examples/derive_ref/augment_args.rs b/vendor/clap/examples/derive_ref/augment_args.rs
deleted file mode 100644
index 390c72f4a..000000000
--- a/vendor/clap/examples/derive_ref/augment_args.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-use clap::{arg, Args as _, Command, FromArgMatches as _, Parser};
-
-#[derive(Parser, Debug)]
-struct DerivedArgs {
- #[clap(short, long, action)]
- derived: bool,
-}
-
-fn main() {
- let cli = Command::new("CLI").arg(arg!(-b - -built).action(clap::ArgAction::SetTrue));
- // Augment built args with derived args
- let cli = DerivedArgs::augment_args(cli);
-
- let matches = cli.get_matches();
- println!(
- "Value of built: {:?}",
- *matches.get_one::<bool>("built").unwrap()
- );
- println!(
- "Value of derived via ArgMatches: {:?}",
- *matches.get_one::<bool>("derived").unwrap()
- );
-
- // Since DerivedArgs implements FromArgMatches, we can extract it from the unstructured ArgMatches.
- // This is the main benefit of using derived arguments.
- let derived_matches = DerivedArgs::from_arg_matches(&matches)
- .map_err(|err| err.exit())
- .unwrap();
- println!("Value of derived: {:#?}", derived_matches);
-}
diff --git a/vendor/clap/examples/git.rs b/vendor/clap/examples/git.rs
deleted file mode 100644
index 5536f1487..000000000
--- a/vendor/clap/examples/git.rs
+++ /dev/null
@@ -1,103 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use std::ffi::OsString;
-use std::path::PathBuf;
-
-use clap::{arg, Command};
-
-fn cli() -> Command<'static> {
- Command::new("git")
- .about("A fictional versioning CLI")
- .subcommand_required(true)
- .arg_required_else_help(true)
- .allow_external_subcommands(true)
- .allow_invalid_utf8_for_external_subcommands(true)
- .subcommand(
- Command::new("clone")
- .about("Clones repos")
- .arg(arg!(<REMOTE> "The remote to clone"))
- .arg_required_else_help(true),
- )
- .subcommand(
- Command::new("push")
- .about("pushes things")
- .arg(arg!(<REMOTE> "The remote to target"))
- .arg_required_else_help(true),
- )
- .subcommand(
- Command::new("add")
- .about("adds things")
- .arg_required_else_help(true)
- .arg(arg!(<PATH> ... "Stuff to add").value_parser(clap::value_parser!(PathBuf))),
- )
- .subcommand(
- Command::new("stash")
- .args_conflicts_with_subcommands(true)
- .args(push_args())
- .subcommand(Command::new("push").args(push_args()))
- .subcommand(Command::new("pop").arg(arg!([STASH])))
- .subcommand(Command::new("apply").arg(arg!([STASH]))),
- )
-}
-
-fn push_args() -> Vec<clap::Arg<'static>> {
- vec![arg!(-m --message <MESSAGE>).required(false)]
-}
-
-fn main() {
- let matches = cli().get_matches();
-
- match matches.subcommand() {
- Some(("clone", sub_matches)) => {
- println!(
- "Cloning {}",
- sub_matches.get_one::<String>("REMOTE").expect("required")
- );
- }
- Some(("push", sub_matches)) => {
- println!(
- "Pushing to {}",
- sub_matches.get_one::<String>("REMOTE").expect("required")
- );
- }
- Some(("add", sub_matches)) => {
- let paths = sub_matches
- .get_many::<PathBuf>("PATH")
- .into_iter()
- .flatten()
- .collect::<Vec<_>>();
- println!("Adding {:?}", paths);
- }
- Some(("stash", sub_matches)) => {
- let stash_command = sub_matches.subcommand().unwrap_or(("push", sub_matches));
- match stash_command {
- ("apply", sub_matches) => {
- let stash = sub_matches.get_one::<String>("STASH");
- println!("Applying {:?}", stash);
- }
- ("pop", sub_matches) => {
- let stash = sub_matches.get_one::<String>("STASH");
- println!("Popping {:?}", stash);
- }
- ("push", sub_matches) => {
- let message = sub_matches.get_one::<String>("message");
- println!("Pushing {:?}", message);
- }
- (name, _) => {
- unreachable!("Unsupported subcommand `{}`", name)
- }
- }
- }
- Some((ext, sub_matches)) => {
- let args = sub_matches
- .get_many::<OsString>("")
- .into_iter()
- .flatten()
- .collect::<Vec<_>>();
- println!("Calling out to {:?} with {:?}", ext, args);
- }
- _ => unreachable!(), // If all subcommands are defined above, anything else is unreachabe!()
- }
-
- // Continued program logic goes here...
-}
diff --git a/vendor/clap/examples/multicall-hostname.md b/vendor/clap/examples/multicall-hostname.md
deleted file mode 100644
index 9e17ca16c..000000000
--- a/vendor/clap/examples/multicall-hostname.md
+++ /dev/null
@@ -1,14 +0,0 @@
-*Jump to [source](multicall-hostname.rs)*
-
-Example of a `hostname-style` multicall program
-
-See the documentation for `clap::Command::multicall` for rationale.
-
-This example omits the implementation of displaying address config
-
-```console
-$ hostname
-www
-
-```
-*Note: without the links setup, we can't demonstrate the multicall behavior*
diff --git a/vendor/clap/examples/pacman.rs b/vendor/clap/examples/pacman.rs
deleted file mode 100644
index 6a60a8bf5..000000000
--- a/vendor/clap/examples/pacman.rs
+++ /dev/null
@@ -1,114 +0,0 @@
-use clap::{Arg, ArgAction, Command};
-
-fn main() {
- let matches = Command::new("pacman")
- .about("package manager utility")
- .version("5.2.1")
- .subcommand_required(true)
- .arg_required_else_help(true)
- .author("Pacman Development Team")
- // Query subcommand
- //
- // Only a few of its arguments are implemented below.
- .subcommand(
- Command::new("query")
- .short_flag('Q')
- .long_flag("query")
- .about("Query the package database.")
- .arg(
- Arg::new("search")
- .short('s')
- .long("search")
- .help("search locally installed packages for matching strings")
- .conflicts_with("info")
- .takes_value(true)
- .multiple_values(true),
- )
- .arg(
- Arg::new("info")
- .long("info")
- .short('i')
- .conflicts_with("search")
- .help("view package information")
- .takes_value(true)
- .multiple_values(true),
- ),
- )
- // Sync subcommand
- //
- // Only a few of its arguments are implemented below.
- .subcommand(
- Command::new("sync")
- .short_flag('S')
- .long_flag("sync")
- .about("Synchronize packages.")
- .arg(
- Arg::new("search")
- .short('s')
- .long("search")
- .conflicts_with("info")
- .takes_value(true)
- .multiple_values(true)
- .help("search remote repositories for matching strings"),
- )
- .arg(
- Arg::new("info")
- .long("info")
- .conflicts_with("search")
- .short('i')
- .action(ArgAction::SetTrue)
- .help("view package information"),
- )
- .arg(
- Arg::new("package")
- .help("packages")
- .required_unless_present("search")
- .takes_value(true)
- .multiple_values(true),
- ),
- )
- .get_matches();
-
- match matches.subcommand() {
- Some(("sync", sync_matches)) => {
- if sync_matches.contains_id("search") {
- let packages: Vec<_> = sync_matches
- .get_many::<String>("search")
- .expect("contains_id")
- .map(|s| s.as_str())
- .collect();
- let values = packages.join(", ");
- println!("Searching for {}...", values);
- return;
- }
-
- let packages: Vec<_> = sync_matches
- .get_many::<String>("package")
- .expect("is present")
- .map(|s| s.as_str())
- .collect();
- let values = packages.join(", ");
-
- if *sync_matches
- .get_one::<bool>("info")
- .expect("defaulted by clap")
- {
- println!("Retrieving info for {}...", values);
- } else {
- println!("Installing {}...", values);
- }
- }
- Some(("query", query_matches)) => {
- if let Some(packages) = query_matches.get_many::<String>("info") {
- let comma_sep = packages.map(|s| s.as_str()).collect::<Vec<_>>().join(", ");
- println!("Retrieving info for {}...", comma_sep);
- } else if let Some(queries) = query_matches.get_many::<String>("search") {
- let comma_sep = queries.map(|s| s.as_str()).collect::<Vec<_>>().join(", ");
- println!("Searching Locally for {}...", comma_sep);
- } else {
- println!("Displaying all locally installed packages...");
- }
- }
- _ => unreachable!(), // If all subcommands are defined above, anything else is unreachable
- }
-}
diff --git a/vendor/clap/examples/tutorial_builder/02_crate.rs b/vendor/clap/examples/tutorial_builder/02_crate.rs
deleted file mode 100644
index 16b7e7ee0..000000000
--- a/vendor/clap/examples/tutorial_builder/02_crate.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{arg, command};
-
-fn main() {
- let matches = command!()
- .arg(arg!(--two <VALUE>))
- .arg(arg!(--one <VALUE>))
- .get_matches();
-
- println!(
- "two: {:?}",
- matches.get_one::<String>("two").expect("required")
- );
- println!(
- "one: {:?}",
- matches.get_one::<String>("one").expect("required")
- );
-}
diff --git a/vendor/clap/examples/tutorial_builder/03_01_flag_bool.rs b/vendor/clap/examples/tutorial_builder/03_01_flag_bool.rs
deleted file mode 100644
index 41ecbb1d7..000000000
--- a/vendor/clap/examples/tutorial_builder/03_01_flag_bool.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{command, Arg, ArgAction};
-
-fn main() {
- let matches = command!()
- .arg(
- Arg::new("verbose")
- .short('v')
- .long("verbose")
- .action(ArgAction::SetTrue),
- )
- .get_matches();
-
- println!(
- "verbose: {:?}",
- *matches
- .get_one::<bool>("verbose")
- .expect("defaulted by clap")
- );
-}
diff --git a/vendor/clap/examples/tutorial_builder/03_01_flag_count.rs b/vendor/clap/examples/tutorial_builder/03_01_flag_count.rs
deleted file mode 100644
index 764affbd8..000000000
--- a/vendor/clap/examples/tutorial_builder/03_01_flag_count.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{arg, command, ArgAction};
-
-fn main() {
- let matches = command!()
- .arg(arg!(-v - -verbose).action(ArgAction::Count))
- .get_matches();
-
- println!(
- "verbose: {:?}",
- matches
- .get_one::<u8>("verbose")
- .expect("Count always defaulted")
- );
-}
diff --git a/vendor/clap/examples/tutorial_builder/03_02_option.rs b/vendor/clap/examples/tutorial_builder/03_02_option.rs
deleted file mode 100644
index 80e2b9159..000000000
--- a/vendor/clap/examples/tutorial_builder/03_02_option.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{arg, command};
-
-fn main() {
- let matches = command!()
- .arg(arg!(-n --name <NAME>).required(false))
- .get_matches();
-
- println!("name: {:?}", matches.get_one::<String>("name"));
-}
diff --git a/vendor/clap/examples/tutorial_builder/03_03_positional.rs b/vendor/clap/examples/tutorial_builder/03_03_positional.rs
deleted file mode 100644
index c6579409a..000000000
--- a/vendor/clap/examples/tutorial_builder/03_03_positional.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{arg, command};
-
-fn main() {
- let matches = command!().arg(arg!([NAME])).get_matches();
-
- println!("NAME: {:?}", matches.get_one::<String>("NAME"));
-}
diff --git a/vendor/clap/examples/tutorial_builder/04_01_enum.rs b/vendor/clap/examples/tutorial_builder/04_01_enum.rs
deleted file mode 100644
index ad2177c23..000000000
--- a/vendor/clap/examples/tutorial_builder/04_01_enum.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{arg, command, value_parser, ValueEnum};
-
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
-enum Mode {
- Fast,
- Slow,
-}
-
-fn main() {
- let matches = command!()
- .arg(
- arg!(<MODE>)
- .help("What mode to run the program in")
- .value_parser(value_parser!(Mode)),
- )
- .get_matches();
-
- // Note, it's safe to call unwrap() because the arg is required
- match matches
- .get_one::<Mode>("MODE")
- .expect("'MODE' is required and parsing will fail if its missing")
- {
- Mode::Fast => {
- println!("Hare");
- }
- Mode::Slow => {
- println!("Tortoise");
- }
- }
-}
diff --git a/vendor/clap/examples/tutorial_builder/04_03_relations.rs b/vendor/clap/examples/tutorial_builder/04_03_relations.rs
deleted file mode 100644
index 605e5b48e..000000000
--- a/vendor/clap/examples/tutorial_builder/04_03_relations.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use std::path::PathBuf;
-
-use clap::{arg, command, value_parser, ArgAction, ArgGroup};
-
-fn main() {
- // Create application like normal
- let matches = command!()
- // Add the version arguments
- .arg(arg!(--"set-ver" <VER> "set version manually").required(false))
- .arg(arg!(--major "auto inc major").action(ArgAction::SetTrue))
- .arg(arg!(--minor "auto inc minor").action(ArgAction::SetTrue))
- .arg(arg!(--patch "auto inc patch").action(ArgAction::SetTrue))
- // Create a group, make it required, and add the above arguments
- .group(
- ArgGroup::new("vers")
- .required(true)
- .args(&["set-ver", "major", "minor", "patch"]),
- )
- // Arguments can also be added to a group individually, these two arguments
- // are part of the "input" group which is not required
- .arg(
- arg!([INPUT_FILE] "some regular input")
- .value_parser(value_parser!(PathBuf))
- .group("input"),
- )
- .arg(
- arg!(--"spec-in" <SPEC_IN> "some special input argument")
- .required(false)
- .value_parser(value_parser!(PathBuf))
- .group("input"),
- )
- // Now let's assume we have a -c [config] argument which requires one of
- // (but **not** both) the "input" arguments
- .arg(
- arg!(config: -c <CONFIG>)
- .required(false)
- .value_parser(value_parser!(PathBuf))
- .requires("input"),
- )
- .get_matches();
-
- // Let's assume the old version 1.2.3
- let mut major = 1;
- let mut minor = 2;
- let mut patch = 3;
-
- // See if --set-ver was used to set the version manually
- let version = if let Some(ver) = matches.get_one::<String>("set-ver") {
- ver.to_owned()
- } else {
- // Increment the one requested (in a real program, we'd reset the lower numbers)
- let (maj, min, pat) = (
- *matches.get_one::<bool>("major").expect("defaulted by clap"),
- *matches.get_one::<bool>("minor").expect("defaulted by clap"),
- *matches.get_one::<bool>("patch").expect("defaulted by clap"),
- );
- match (maj, min, pat) {
- (true, _, _) => major += 1,
- (_, true, _) => minor += 1,
- (_, _, true) => patch += 1,
- _ => unreachable!(),
- };
- format!("{}.{}.{}", major, minor, patch)
- };
-
- println!("Version: {}", version);
-
- // Check for usage of -c
- if matches.contains_id("config") {
- let input = matches
- .get_one::<PathBuf>("INPUT_FILE")
- .unwrap_or_else(|| matches.get_one::<PathBuf>("spec-in").unwrap())
- .display();
- println!(
- "Doing work using input {} and config {}",
- input,
- matches.get_one::<PathBuf>("config").unwrap().display()
- );
- }
-}
diff --git a/vendor/clap/examples/tutorial_builder/05_01_assert.rs b/vendor/clap/examples/tutorial_builder/05_01_assert.rs
deleted file mode 100644
index d6f19ffe5..000000000
--- a/vendor/clap/examples/tutorial_builder/05_01_assert.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Note: this requires the `cargo` feature
-
-use clap::{arg, command, value_parser};
-
-fn main() {
- let matches = cmd().get_matches();
-
- // Note, it's safe to call unwrap() because the arg is required
- let port: usize = *matches
- .get_one::<usize>("PORT")
- .expect("'PORT' is required and parsing will fail if its missing");
- println!("PORT = {}", port);
-}
-
-fn cmd() -> clap::Command<'static> {
- command!().arg(
- arg!(<PORT>)
- .help("Network port to use")
- .value_parser(value_parser!(usize)),
- )
-}
-
-#[test]
-fn verify_app() {
- cmd().debug_assert();
-}
diff --git a/vendor/clap/examples/tutorial_builder/README.md b/vendor/clap/examples/tutorial_builder/README.md
deleted file mode 100644
index 945b01e72..000000000
--- a/vendor/clap/examples/tutorial_builder/README.md
+++ /dev/null
@@ -1,658 +0,0 @@
-# Tutorial
-
-*Jump to [derive tutorial](../tutorial_derive/README.md)*
-
-1. [Quick Start](#quick-start)
-2. [Configuring the Parser](#configuring-the-parser)
-3. [Adding Arguments](#adding-arguments)
- 1. [Positionals](#positionals)
- 2. [Options](#options)
- 3. [Flags](#flags)
- 4. [Subcommands](#subcommands)
- 5. [Defaults](#defaults)
-4. Validation
- 1. [Enumerated values](#enumerated-values)
- 2. [Validated values](#validated-values)
- 3. [Argument Relations](#argument-relations)
- 4. [Custom Validation](#custom-validation)
-5. [Tips](#tips)
-6. [Contributing](#contributing)
-
-## Quick Start
-
-You can create an application with several arguments using usage strings.
-
-[Example:](01_quick.rs)
-```console
-$ 01_quick --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 01_quick[EXE] [OPTIONS] [name] [SUBCOMMAND]
-
-ARGS:
- <name> Optional name to operate on
-
-OPTIONS:
- -c, --config <FILE> Sets a custom config file
- -d, --debug Turn debugging information on
- -h, --help Print help information
- -V, --version Print version information
-
-SUBCOMMANDS:
- help Print this message or the help of the given subcommand(s)
- test does testing things
-
-```
-
-By default, the program does nothing:
-```console
-$ 01_quick
-Debug mode is off
-
-```
-
-But you can mix and match the various features
-```console
-$ 01_quick -dd test
-Debug mode is on
-Not printing testing lists...
-
-```
-
-## Configuring the Parser
-
-You use the `Command` the start building a parser.
-
-[Example:](02_apps.rs)
-```console
-$ 02_apps --help
-MyApp 1.0
-Kevin K. <kbknapp@gmail.com>
-Does awesome things
-
-USAGE:
- 02_apps[EXE] --two <VALUE> --one <VALUE>
-
-OPTIONS:
- -h, --help Print help information
- --one <VALUE>
- --two <VALUE>
- -V, --version Print version information
-
-$ 02_apps --version
-MyApp 1.0
-
-```
-
-You can use `command!()` to fill these fields in from your `Cargo.toml`
-file. **This requires the `cargo` feature flag.**
-
-[Example:](02_crate.rs)
-```console
-$ 02_crate --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 02_crate[EXE] --two <VALUE> --one <VALUE>
-
-OPTIONS:
- -h, --help Print help information
- --one <VALUE>
- --two <VALUE>
- -V, --version Print version information
-
-$ 02_crate --version
-clap [..]
-
-```
-
-You can use `Command` methods to change the application level behavior of clap.
-
-[Example:](02_app_settings.rs)
-```console
-$ 02_app_settings --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 02_app_settings[EXE] --two <VALUE> --one <VALUE>
-
-OPTIONS:
- --two <VALUE>
- --one <VALUE>
- -h, --help Print help information
- -V, --version Print version information
-
-$ 02_app_settings --one -1 --one -3 --two 10
-two: "10"
-one: "-3"
-
-```
-
-## Adding Arguments
-
-### Positionals
-
-You can have users specify values by their position on the command-line:
-
-[Example:](03_03_positional.rs)
-```console
-$ 03_03_positional --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_03_positional[EXE] [NAME]
-
-ARGS:
- <NAME>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 03_03_positional
-NAME: None
-
-$ 03_03_positional bob
-NAME: Some("bob")
-
-```
-
-### Options
-
-You can name your arguments with a flag:
-- Order doesn't matter
-- They can be optional
-- Intent is clearer
-
-[Example:](03_02_option.rs)
-```console
-$ 03_02_option --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_02_option[EXE] [OPTIONS]
-
-OPTIONS:
- -h, --help Print help information
- -n, --name <NAME>
- -V, --version Print version information
-
-$ 03_02_option
-name: None
-
-$ 03_02_option --name bob
-name: Some("bob")
-
-$ 03_02_option --name=bob
-name: Some("bob")
-
-$ 03_02_option -n bob
-name: Some("bob")
-
-$ 03_02_option -n=bob
-name: Some("bob")
-
-$ 03_02_option -nbob
-name: Some("bob")
-
-```
-
-### Flags
-
-Flags can also be switches that can be on/off:
-
-[Example:](03_01_flag_bool.rs)
-```console
-$ 03_01_flag_bool --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_01_flag_bool[EXE] [OPTIONS]
-
-OPTIONS:
- -h, --help Print help information
- -v, --verbose
- -V, --version Print version information
-
-$ 03_01_flag_bool
-verbose: false
-
-$ 03_01_flag_bool --verbose
-verbose: true
-
-$ 03_01_flag_bool --verbose --verbose
-verbose: true
-
-```
-
-Or counted.
-
-[Example:](03_01_flag_count.rs)
-```console
-$ 03_01_flag_count --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_01_flag_count[EXE] [OPTIONS]
-
-OPTIONS:
- -h, --help Print help information
- -v, --verbose
- -V, --version Print version information
-
-$ 03_01_flag_count
-verbose: 0
-
-$ 03_01_flag_count --verbose
-verbose: 1
-
-$ 03_01_flag_count --verbose --verbose
-verbose: 2
-
-```
-
-### Subcommands
-
-Subcommands are defined as `Command`s that get added via `Command::subcommand`. Each
-instance of a Subcommand can have its own version, author(s), Args, and even its own
-subcommands.
-
-[Example:](03_04_subcommands.rs)
-```console
-$ 03_04_subcommands help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_04_subcommands[EXE] <SUBCOMMAND>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-SUBCOMMANDS:
- add Adds files to myapp
- help Print this message or the help of the given subcommand(s)
-
-$ 03_04_subcommands help add
-03_04_subcommands[EXE]-add [..]
-Adds files to myapp
-
-USAGE:
- 03_04_subcommands[EXE] add [NAME]
-
-ARGS:
- <NAME>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 03_04_subcommands add bob
-'myapp add' was used, name is: Some("bob")
-
-```
-
-Because we set `Command::arg_required_else_help`:
-```console
-$ 03_04_subcommands
-? failed
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_04_subcommands[EXE] <SUBCOMMAND>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-SUBCOMMANDS:
- add Adds files to myapp
- help Print this message or the help of the given subcommand(s)
-
-```
-
-Because we set `Command::propagate_version`:
-```console
-$ 03_04_subcommands --version
-clap [..]
-
-$ 03_04_subcommands add --version
-03_04_subcommands[EXE]-add [..]
-
-```
-
-### Defaults
-
-We've previously showed that arguments can be `required` or optional. When
-optional, you work with a `Option` and can `unwrap_or`. Alternatively, you can
-set `Arg::default_value`.
-
-[Example:](03_05_default_values.rs)
-```console
-$ 03_05_default_values --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_05_default_values[EXE] [NAME]
-
-ARGS:
- <NAME> [default: alice]
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 03_05_default_values
-NAME: "alice"
-
-$ 03_05_default_values bob
-NAME: "bob"
-
-```
-
-## Validation
-
-### Enumerated values
-
-If you have arguments of specific values you want to test for, you can use the
-`PossibleValuesParser` or `Arg::value_parser(["val1", ...])` for short.
-
-This allows you specify the valid values for that argument. If the user does not use one of
-those specific values, they will receive a graceful exit with error message informing them
-of the mistake, and what the possible valid values are
-
-[Example:](04_01_possible.rs)
-```console
-$ 04_01_possible --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_01_possible[EXE] <MODE>
-
-ARGS:
- <MODE> What mode to run the program in [possible values: fast, slow]
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_01_possible fast
-Hare
-
-$ 04_01_possible slow
-Tortoise
-
-$ 04_01_possible medium
-? failed
-error: "medium" isn't a valid value for '<MODE>'
- [possible values: fast, slow]
-
-For more information try --help
-
-```
-
-When enabling the `derive` feature, you can use `ValueEnum` to take care of the boiler plate for you, giving the same results.
-
-[Example:](04_01_enum.rs)
-```console
-$ 04_01_enum --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_01_enum[EXE] <MODE>
-
-ARGS:
- <MODE> What mode to run the program in [possible values: fast, slow]
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_01_enum fast
-Hare
-
-$ 04_01_enum slow
-Tortoise
-
-$ 04_01_enum medium
-? failed
-error: "medium" isn't a valid value for '<MODE>'
- [possible values: fast, slow]
-
-For more information try --help
-
-```
-
-### Validated values
-
-More generally, you can validate and parse into any data type.
-
-[Example:](04_02_parse.rs)
-```console
-$ 04_02_parse --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_02_parse[EXE] <PORT>
-
-ARGS:
- <PORT> Network port to use
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_02_parse 22
-PORT = 22
-
-$ 04_02_parse foobar
-? failed
-error: Invalid value "foobar" for '<PORT>': invalid digit found in string
-
-For more information try --help
-
-$ 04_02_parse_derive 0
-? failed
-error: Invalid value "0" for '<PORT>': 0 is not in 1..=65535
-
-For more information try --help
-
-```
-
-A custom parser can be used to improve the error messages or provide additional validation:
-
-[Example:](04_02_validate.rs)
-```console
-$ 04_02_validate --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_02_validate[EXE] <PORT>
-
-ARGS:
- <PORT> Network port to use
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_02_validate 22
-PORT = 22
-
-$ 04_02_validate foobar
-? failed
-error: Invalid value "foobar" for '<PORT>': `foobar` isn't a port number
-
-For more information try --help
-
-$ 04_02_validate 0
-? failed
-error: Invalid value "0" for '<PORT>': Port not in range 1-65535
-
-For more information try --help
-
-```
-
-### Argument Relations
-
-You can declare dependencies or conflicts between `Arg`s or even `ArgGroup`s.
-
-`ArgGroup`s make it easier to declare relations instead of having to list each
-individually, or when you want a rule to apply "any but not all" arguments.
-
-Perhaps the most common use of `ArgGroup`s is to require one and *only* one argument to be
-present out of a given set. Imagine that you had multiple arguments, and you want one of them to
-be required, but making all of them required isn't feasible because perhaps they conflict with
-each other.
-
-[Example:](04_03_relations.rs)
-```console
-$ 04_03_relations --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_03_relations[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
-
-ARGS:
- <INPUT_FILE> some regular input
-
-OPTIONS:
- -c <CONFIG>
- -h, --help Print help information
- --major auto inc major
- --minor auto inc minor
- --patch auto inc patch
- --set-ver <VER> set version manually
- --spec-in <SPEC_IN> some special input argument
- -V, --version Print version information
-
-$ 04_03_relations
-? failed
-error: The following required arguments were not provided:
- <--set-ver <VER>|--major|--minor|--patch>
-
-USAGE:
- 04_03_relations[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
-
-For more information try --help
-
-$ 04_03_relations --major
-Version: 2.2.3
-
-$ 04_03_relations --major --minor
-? failed
-error: The argument '--major' cannot be used with '--minor'
-
-USAGE:
- 04_03_relations[EXE] <--set-ver <VER>|--major|--minor|--patch>
-
-For more information try --help
-
-$ 04_03_relations --major -c config.toml
-? failed
-error: The following required arguments were not provided:
- <INPUT_FILE|--spec-in <SPEC_IN>>
-
-USAGE:
- 04_03_relations[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
-
-For more information try --help
-
-$ 04_03_relations --major -c config.toml --spec-in input.txt
-Version: 2.2.3
-Doing work using input input.txt and config config.toml
-
-```
-
-### Custom Validation
-
-As a last resort, you can create custom errors with the basics of clap's formatting.
-
-[Example:](04_04_custom.rs)
-```console
-$ 04_04_custom --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
-
-ARGS:
- <INPUT_FILE> some regular input
-
-OPTIONS:
- -c <CONFIG>
- -h, --help Print help information
- --major auto inc major
- --minor auto inc minor
- --patch auto inc patch
- --set-ver <VER> set version manually
- --spec-in <SPEC_IN> some special input argument
- -V, --version Print version information
-
-$ 04_04_custom
-? failed
-error: Can only modify one version field
-
-USAGE:
- 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
-
-For more information try --help
-
-$ 04_04_custom --major
-Version: 2.2.3
-
-$ 04_04_custom --major --minor
-? failed
-error: Can only modify one version field
-
-USAGE:
- 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
-
-For more information try --help
-
-$ 04_04_custom --major -c config.toml
-? failed
-Version: 2.2.3
-error: INPUT_FILE or --spec-in is required when using --config
-
-USAGE:
- 04_04_custom[EXE] [OPTIONS] [INPUT_FILE]
-
-For more information try --help
-
-$ 04_04_custom --major -c config.toml --spec-in input.txt
-Version: 2.2.3
-Doing work using input input.txt and config config.toml
-
-```
-
-## Tips
-
-- For more complex demonstration of features, see our [examples](../README.md).
-- Proactively check for bad `Command` configurations by calling `Command::debug_assert` in a test ([example](05_01_assert.rs))
-
-## Contributing
-
-New example code:
-- Please update the corresponding section in the [derive tutorial](../tutorial_derive/README.md)
-- Building: They must be added to [Cargo.toml](../../Cargo.toml) with the appropriate `required-features`.
-- Testing: Ensure there is a markdown file with [trycmd](https://docs.rs/trycmd) syntax (generally they'll go in here).
-
-See also the general [CONTRIBUTING](../../CONTRIBUTING.md).
diff --git a/vendor/clap/examples/tutorial_derive/02_crate.rs b/vendor/clap/examples/tutorial_derive/02_crate.rs
deleted file mode 100644
index df16468d0..000000000
--- a/vendor/clap/examples/tutorial_derive/02_crate.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-use clap::Parser;
-
-#[derive(Parser)]
-#[clap(author, version, about, long_about = None)]
-struct Cli {
- #[clap(long, value_parser)]
- two: String,
- #[clap(long, value_parser)]
- one: String,
-}
-
-fn main() {
- let cli = Cli::parse();
-
- println!("two: {:?}", cli.two);
- println!("one: {:?}", cli.one);
-}
diff --git a/vendor/clap/examples/tutorial_derive/04_01_enum.rs b/vendor/clap/examples/tutorial_derive/04_01_enum.rs
deleted file mode 100644
index 84b4cace4..000000000
--- a/vendor/clap/examples/tutorial_derive/04_01_enum.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-use clap::{ArgEnum, Parser};
-
-#[derive(Parser)]
-#[clap(author, version, about, long_about = None)]
-struct Cli {
- /// What mode to run the program in
- #[clap(arg_enum, value_parser)]
- mode: Mode,
-}
-
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ArgEnum)]
-enum Mode {
- Fast,
- Slow,
-}
-
-fn main() {
- let cli = Cli::parse();
-
- match cli.mode {
- Mode::Fast => {
- println!("Hare");
- }
- Mode::Slow => {
- println!("Tortoise");
- }
- }
-}
diff --git a/vendor/clap/examples/tutorial_derive/04_03_relations.rs b/vendor/clap/examples/tutorial_derive/04_03_relations.rs
deleted file mode 100644
index f8523902d..000000000
--- a/vendor/clap/examples/tutorial_derive/04_03_relations.rs
+++ /dev/null
@@ -1,72 +0,0 @@
-use clap::{ArgGroup, Parser};
-
-#[derive(Parser)]
-#[clap(author, version, about, long_about = None)]
-#[clap(group(
- ArgGroup::new("vers")
- .required(true)
- .args(&["set-ver", "major", "minor", "patch"]),
- ))]
-struct Cli {
- /// set version manually
- #[clap(long, value_name = "VER", value_parser)]
- set_ver: Option<String>,
-
- /// auto inc major
- #[clap(long, action)]
- major: bool,
-
- /// auto inc minor
- #[clap(long, action)]
- minor: bool,
-
- /// auto inc patch
- #[clap(long, action)]
- patch: bool,
-
- /// some regular input
- #[clap(group = "input", value_parser)]
- input_file: Option<String>,
-
- /// some special input argument
- #[clap(long, group = "input", value_parser)]
- spec_in: Option<String>,
-
- #[clap(short, requires = "input", value_parser)]
- config: Option<String>,
-}
-
-fn main() {
- let cli = Cli::parse();
-
- // Let's assume the old version 1.2.3
- let mut major = 1;
- let mut minor = 2;
- let mut patch = 3;
-
- // See if --set-ver was used to set the version manually
- let version = if let Some(ver) = cli.set_ver.as_deref() {
- ver.to_string()
- } else {
- // Increment the one requested (in a real program, we'd reset the lower numbers)
- let (maj, min, pat) = (cli.major, cli.minor, cli.patch);
- match (maj, min, pat) {
- (true, _, _) => major += 1,
- (_, true, _) => minor += 1,
- (_, _, true) => patch += 1,
- _ => unreachable!(),
- };
- format!("{}.{}.{}", major, minor, patch)
- };
-
- println!("Version: {}", version);
-
- // Check for usage of -c
- if let Some(config) = cli.config.as_deref() {
- let input = cli
- .input_file
- .as_deref()
- .unwrap_or_else(|| cli.spec_in.as_deref().unwrap());
- println!("Doing work using input {} and config {}", input, config);
- }
-}
diff --git a/vendor/clap/examples/tutorial_derive/05_01_assert.rs b/vendor/clap/examples/tutorial_derive/05_01_assert.rs
deleted file mode 100644
index f5fa3f6c5..000000000
--- a/vendor/clap/examples/tutorial_derive/05_01_assert.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-use clap::Parser;
-
-#[derive(Parser)]
-#[clap(author, version, about, long_about = None)]
-struct Cli {
- /// Network port to use
- #[clap(value_parser)]
- port: u16,
-}
-
-fn main() {
- let cli = Cli::parse();
-
- println!("PORT = {}", cli.port);
-}
-
-#[test]
-fn verify_app() {
- use clap::CommandFactory;
- Cli::command().debug_assert()
-}
diff --git a/vendor/clap/examples/tutorial_derive/README.md b/vendor/clap/examples/tutorial_derive/README.md
deleted file mode 100644
index 6127b6cd3..000000000
--- a/vendor/clap/examples/tutorial_derive/README.md
+++ /dev/null
@@ -1,639 +0,0 @@
-# Tutorial
-
-*Jump to [builder tutorial](../tutorial_builder/README.md)*
-
-1. [Quick Start](#quick-start)
-2. [Configuring the Parser](#configuring-the-parser)
-3. [Adding Arguments](#adding-arguments)
- 1. [Positionals](#positionals)
- 2. [Options](#options)
- 3. [Flags](#flags)
- 4. [Subcommands](#subcommands)
- 5. [Defaults](#defaults)
-4. Validation
- 1. [Enumerated values](#enumerated-values)
- 2. [Validated values](#validated-values)
- 3. [Argument Relations](#argument-relations)
- 4. [Custom Validation](#custom-validation)
-5. [Tips](#tips)
-6. [Contributing](#contributing)
-
-## Quick Start
-
-You can create an application declaratively with a `struct` and some
-attributes. **This requires enabling the `derive` feature flag.**
-
-[Example:](01_quick.rs)
-```console
-$ 01_quick_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 01_quick_derive[EXE] [OPTIONS] [NAME] [SUBCOMMAND]
-
-ARGS:
- <NAME> Optional name to operate on
-
-OPTIONS:
- -c, --config <FILE> Sets a custom config file
- -d, --debug Turn debugging information on
- -h, --help Print help information
- -V, --version Print version information
-
-SUBCOMMANDS:
- help Print this message or the help of the given subcommand(s)
- test does testing things
-
-```
-
-By default, the program does nothing:
-```console
-$ 01_quick_derive
-Debug mode is off
-
-```
-
-But you can mix and match the various features
-```console
-$ 01_quick_derive -dd test
-Debug mode is on
-Not printing testing lists...
-
-```
-
-In addition to this tutorial, see the [derive reference](../derive_ref/README.md).
-
-## Configuring the Parser
-
-You use derive `Parser` the start building a parser.
-
-[Example:](02_apps.rs)
-```console
-$ 02_apps_derive --help
-MyApp 1.0
-Kevin K. <kbknapp@gmail.com>
-Does awesome things
-
-USAGE:
- 02_apps_derive[EXE] --two <TWO> --one <ONE>
-
-OPTIONS:
- -h, --help Print help information
- --one <ONE>
- --two <TWO>
- -V, --version Print version information
-
-$ 02_apps_derive --version
-MyApp 1.0
-
-```
-
-You can use `#[clap(author, version, about)]` attribute defaults to fill these fields in from your `Cargo.toml` file.
-
-[Example:](02_crate.rs)
-```console
-$ 02_crate_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 02_crate_derive[EXE] --two <TWO> --one <ONE>
-
-OPTIONS:
- -h, --help Print help information
- --one <ONE>
- --two <TWO>
- -V, --version Print version information
-
-$ 02_crate_derive --version
-clap [..]
-
-```
-
-You can use attributes to change the application level behavior of clap. Any `Command` builder function can be used as an attribute.
-
-[Example:](02_app_settings.rs)
-```console
-$ 02_app_settings_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 02_app_settings_derive[EXE] --two <TWO> --one <ONE>
-
-OPTIONS:
- --two <TWO>
- --one <ONE>
- -h, --help Print help information
- -V, --version Print version information
-
-$ 02_app_settings_derive --one -1 --one -3 --two 10
-two: "10"
-one: "-3"
-
-```
-
-## Adding Arguments
-
-### Positionals
-
-You can have users specify values by their position on the command-line:
-
-[Example:](03_03_positional.rs)
-```console
-$ 03_03_positional_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_03_positional_derive[EXE] [NAME]
-
-ARGS:
- <NAME>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 03_03_positional_derive
-name: None
-
-$ 03_03_positional_derive bob
-name: Some("bob")
-
-```
-
-### Options
-
-You can name your arguments with a flag:
-- Order doesn't matter
-- They can be optional
-- Intent is clearer
-
-The `#[clap(short = 'c')]` and `#[clap(long = "name")]` attributes that define
-the flags are `Arg` methods that are derived from the field name when no value
-is specified (`#[clap(short)]` and `#[clap(long)]`).
-
-[Example:](03_02_option.rs)
-```console
-$ 03_02_option_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_02_option_derive[EXE] [OPTIONS]
-
-OPTIONS:
- -h, --help Print help information
- -n, --name <NAME>
- -V, --version Print version information
-
-$ 03_02_option_derive
-name: None
-
-$ 03_02_option_derive --name bob
-name: Some("bob")
-
-$ 03_02_option_derive --name=bob
-name: Some("bob")
-
-$ 03_02_option_derive -n bob
-name: Some("bob")
-
-$ 03_02_option_derive -n=bob
-name: Some("bob")
-
-$ 03_02_option_derive -nbob
-name: Some("bob")
-
-```
-
-### Flags
-
-Flags can also be switches that can be on/off. This is enabled via the
-`#[clap(parse(from_flag)]` attribute though this is implied when the field is a
-`bool`.
-
-[Example:](03_01_flag_bool.rs)
-```console
-$ 03_01_flag_bool_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_01_flag_bool_derive[EXE] [OPTIONS]
-
-OPTIONS:
- -h, --help Print help information
- -v, --verbose
- -V, --version Print version information
-
-$ 03_01_flag_bool_derive
-verbose: false
-
-$ 03_01_flag_bool_derive --verbose
-verbose: true
-
-$ 03_01_flag_bool_derive --verbose --verbose
-verbose: true
-
-```
-
-Or counted with `#[clap(action = clap::ArgAction::Count)]`:
-
-[Example:](03_01_flag_count.rs)
-```console
-$ 03_01_flag_count_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_01_flag_count_derive[EXE] [OPTIONS]
-
-OPTIONS:
- -h, --help Print help information
- -v, --verbose
- -V, --version Print version information
-
-$ 03_01_flag_count_derive
-verbose: 0
-
-$ 03_01_flag_count_derive --verbose
-verbose: 1
-
-$ 03_01_flag_count_derive --verbose --verbose
-verbose: 2
-
-```
-
-### Subcommands
-
-Subcommands are derived with `#[derive(Subcommand)]` and be added via `#[clap(subcommand)]` attribute. Each
-instance of a Subcommand can have its own version, author(s), Args, and even its own
-subcommands.
-
-[Example:](03_04_subcommands.rs)
-```console
-$ 03_04_subcommands_derive help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_04_subcommands_derive[EXE] <SUBCOMMAND>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-SUBCOMMANDS:
- add Adds files to myapp
- help Print this message or the help of the given subcommand(s)
-
-$ 03_04_subcommands_derive help add
-03_04_subcommands_derive[EXE]-add [..]
-Adds files to myapp
-
-USAGE:
- 03_04_subcommands_derive[EXE] add [NAME]
-
-ARGS:
- <NAME>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 03_04_subcommands_derive add bob
-'myapp add' was used, name is: Some("bob")
-
-```
-
-Above, we used a struct-variant to define the `add` subcommand. Alternatively,
-you can
-[use a struct for your subcommand's arguments](03_04_subcommands_alt.rs).
-
-Because we used `command: Commands` instead of `command: Option<Commands>`:
-```console
-$ 03_04_subcommands_derive
-? failed
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_04_subcommands_derive[EXE] <SUBCOMMAND>
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-SUBCOMMANDS:
- add Adds files to myapp
- help Print this message or the help of the given subcommand(s)
-
-```
-
-Because we added `#[clap(propagate_version = true)]`:
-```console
-$ 03_04_subcommands_derive --version
-clap [..]
-
-$ 03_04_subcommands_derive add --version
-03_04_subcommands_derive[EXE]-add [..]
-
-```
-
-### Defaults
-
-We've previously showed that arguments can be `required` or optional. When
-optional, you work with an `Option` and can `unwrap_or`. Alternatively, you can
-set `#[clap(default_value_t)]`.
-
-[Example:](03_05_default_values.rs)
-```console
-$ 03_05_default_values_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 03_05_default_values_derive[EXE] [NAME]
-
-ARGS:
- <NAME> [default: alice]
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 03_05_default_values_derive
-name: "alice"
-
-$ 03_05_default_values_derive bob
-name: "bob"
-
-```
-
-## Validation
-
-### Enumerated values
-
-If you have arguments of specific values you want to test for, you can derive
-`ValueEnum`.
-
-This allows you specify the valid values for that argument. If the user does not use one of
-those specific values, they will receive a graceful exit with error message informing them
-of the mistake, and what the possible valid values are
-
-[Example:](04_01_enum.rs)
-```console
-$ 04_01_enum_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_01_enum_derive[EXE] <MODE>
-
-ARGS:
- <MODE> What mode to run the program in [possible values: fast, slow]
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_01_enum_derive fast
-Hare
-
-$ 04_01_enum_derive slow
-Tortoise
-
-$ 04_01_enum_derive medium
-? failed
-error: "medium" isn't a valid value for '<MODE>'
- [possible values: fast, slow]
-
-For more information try --help
-
-```
-
-### Validated values
-
-More generally, you can validate and parse into any data type.
-
-[Example:](04_02_parse.rs)
-```console
-$ 04_02_parse_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_02_parse_derive[EXE] <PORT>
-
-ARGS:
- <PORT> Network port to use
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_02_parse_derive 22
-PORT = 22
-
-$ 04_02_parse_derive foobar
-? failed
-error: Invalid value "foobar" for '<PORT>': invalid digit found in string
-
-For more information try --help
-
-$ 04_02_parse_derive 0
-? failed
-error: Invalid value "0" for '<PORT>': 0 is not in 1..=65535
-
-For more information try --help
-
-```
-
-A custom parser can be used to improve the error messages or provide additional validation:
-
-[Example:](04_02_validate.rs)
-```console
-$ 04_02_validate_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_02_validate_derive[EXE] <PORT>
-
-ARGS:
- <PORT> Network port to use
-
-OPTIONS:
- -h, --help Print help information
- -V, --version Print version information
-
-$ 04_02_validate_derive 22
-PORT = 22
-
-$ 04_02_validate_derive foobar
-? failed
-error: Invalid value "foobar" for '<PORT>': `foobar` isn't a port number
-
-For more information try --help
-
-$ 04_02_validate_derive 0
-? failed
-error: Invalid value "0" for '<PORT>': Port not in range 1-65535
-
-For more information try --help
-
-```
-
-### Argument Relations
-
-You can declare dependencies or conflicts between `Arg`s or even `ArgGroup`s.
-
-`ArgGroup`s make it easier to declare relations instead of having to list each
-individually, or when you want a rule to apply "any but not all" arguments.
-
-Perhaps the most common use of `ArgGroup`s is to require one and *only* one argument to be
-present out of a given set. Imagine that you had multiple arguments, and you want one of them to
-be required, but making all of them required isn't feasible because perhaps they conflict with
-each other.
-
-[Example:](04_03_relations.rs)
-```console
-$ 04_03_relations_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_03_relations_derive[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
-
-ARGS:
- <INPUT_FILE> some regular input
-
-OPTIONS:
- -c <CONFIG>
- -h, --help Print help information
- --major auto inc major
- --minor auto inc minor
- --patch auto inc patch
- --set-ver <VER> set version manually
- --spec-in <SPEC_IN> some special input argument
- -V, --version Print version information
-
-$ 04_03_relations_derive
-? failed
-error: The following required arguments were not provided:
- <--set-ver <VER>|--major|--minor|--patch>
-
-USAGE:
- 04_03_relations_derive[EXE] [OPTIONS] <--set-ver <VER>|--major|--minor|--patch> [INPUT_FILE]
-
-For more information try --help
-
-$ 04_03_relations_derive --major
-Version: 2.2.3
-
-$ 04_03_relations_derive --major --minor
-? failed
-error: The argument '--major' cannot be used with '--minor'
-
-USAGE:
- 04_03_relations_derive[EXE] <--set-ver <VER>|--major|--minor|--patch>
-
-For more information try --help
-
-$ 04_03_relations_derive --major -c config.toml
-? failed
-error: The following required arguments were not provided:
- <INPUT_FILE|--spec-in <SPEC_IN>>
-
-USAGE:
- 04_03_relations_derive[EXE] -c <CONFIG> <--set-ver <VER>|--major|--minor|--patch> <INPUT_FILE|--spec-in <SPEC_IN>>
-
-For more information try --help
-
-$ 04_03_relations_derive --major -c config.toml --spec-in input.txt
-Version: 2.2.3
-Doing work using input input.txt and config config.toml
-
-```
-
-### Custom Validation
-
-As a last resort, you can create custom errors with the basics of clap's formatting.
-
-[Example:](04_04_custom.rs)
-```console
-$ 04_04_custom_derive --help
-clap [..]
-A simple to use, efficient, and full-featured Command Line Argument Parser
-
-USAGE:
- 04_04_custom_derive[EXE] [OPTIONS] [INPUT_FILE]
-
-ARGS:
- <INPUT_FILE> some regular input
-
-OPTIONS:
- -c <CONFIG>
- -h, --help Print help information
- --major auto inc major
- --minor auto inc minor
- --patch auto inc patch
- --set-ver <VER> set version manually
- --spec-in <SPEC_IN> some special input argument
- -V, --version Print version information
-
-$ 04_04_custom_derive
-? failed
-error: Can only modify one version field
-
-USAGE:
- clap [OPTIONS] [INPUT_FILE]
-
-For more information try --help
-
-$ 04_04_custom_derive --major
-Version: 2.2.3
-
-$ 04_04_custom_derive --major --minor
-? failed
-error: Can only modify one version field
-
-USAGE:
- clap [OPTIONS] [INPUT_FILE]
-
-For more information try --help
-
-$ 04_04_custom_derive --major -c config.toml
-? failed
-Version: 2.2.3
-error: INPUT_FILE or --spec-in is required when using --config
-
-USAGE:
- clap [OPTIONS] [INPUT_FILE]
-
-For more information try --help
-
-$ 04_04_custom_derive --major -c config.toml --spec-in input.txt
-Version: 2.2.3
-Doing work using input input.txt and config config.toml
-
-```
-
-## Tips
-
-- For more complex demonstration of features, see our [examples](../README.md).
-- See the [derive reference](../derive_ref/README.md) to understand how to use
- anything in the [builder API](https://docs.rs/clap/) in the derive API.
-- Proactively check for bad `Command` configurations by calling `Command::debug_assert` in a test ([example](05_01_assert.rs))
-
-## Contributing
-
-New example code:
-- Please update the corresponding section in the [builder tutorial](../tutorial_builder/README.md)
-- Building: They must be added to [Cargo.toml](../../Cargo.toml) with the appropriate `required-features`.
-- Testing: Ensure there is a markdown file with [trycmd](https://docs.rs/trycmd) syntax (generally they'll go in here).
-
-See also the general [CONTRIBUTING](../../CONTRIBUTING.md).
diff --git a/vendor/clap/src/error/kind.rs b/vendor/clap/src/error/kind.rs
deleted file mode 100644
index 21256609a..000000000
--- a/vendor/clap/src/error/kind.rs
+++ /dev/null
@@ -1,440 +0,0 @@
-/// Command line argument parser kind of error
-#[derive(Debug, Copy, Clone, PartialEq)]
-#[non_exhaustive]
-pub enum ErrorKind {
- /// Occurs when an [`Arg`][crate::Arg] has a set of possible values,
- /// and the user provides a value which isn't in that set.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("speed")
- /// .value_parser(["fast", "slow"]))
- /// .try_get_matches_from(vec!["prog", "other"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidValue);
- /// ```
- InvalidValue,
-
- /// Occurs when a user provides a flag, option, argument or subcommand which isn't defined.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(arg!(--flag "some flag"))
- /// .try_get_matches_from(vec!["prog", "--other"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::UnknownArgument);
- /// ```
- UnknownArgument,
-
- /// Occurs when the user provides an unrecognized [`Subcommand`] which meets the threshold for
- /// being similar enough to an existing subcommand.
- /// If it doesn't meet the threshold, or the 'suggestions' feature is disabled,
- /// the more general [`UnknownArgument`] error is returned.
- ///
- /// # Examples
- ///
- #[cfg_attr(not(feature = "suggestions"), doc = " ```no_run")]
- #[cfg_attr(feature = "suggestions", doc = " ```")]
- /// # use clap::{Command, Arg, ErrorKind, };
- /// let result = Command::new("prog")
- /// .subcommand(Command::new("config")
- /// .about("Used for configuration")
- /// .arg(Arg::new("config_file")
- /// .help("The configuration file to use")))
- /// .try_get_matches_from(vec!["prog", "confi"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidSubcommand);
- /// ```
- ///
- /// [`Subcommand`]: crate::Subcommand
- /// [`UnknownArgument`]: ErrorKind::UnknownArgument
- InvalidSubcommand,
-
- /// Occurs when the user provides an unrecognized [`Subcommand`] which either
- /// doesn't meet the threshold for being similar enough to an existing subcommand,
- /// or the 'suggestions' feature is disabled.
- /// Otherwise the more detailed [`InvalidSubcommand`] error is returned.
- ///
- /// This error typically happens when passing additional subcommand names to the `help`
- /// subcommand. Otherwise, the more general [`UnknownArgument`] error is used.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind, };
- /// let result = Command::new("prog")
- /// .subcommand(Command::new("config")
- /// .about("Used for configuration")
- /// .arg(Arg::new("config_file")
- /// .help("The configuration file to use")))
- /// .try_get_matches_from(vec!["prog", "help", "nothing"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::UnrecognizedSubcommand);
- /// ```
- ///
- /// [`Subcommand`]: crate::Subcommand
- /// [`InvalidSubcommand`]: ErrorKind::InvalidSubcommand
- /// [`UnknownArgument`]: ErrorKind::UnknownArgument
- UnrecognizedSubcommand,
-
- /// Occurs when the user provides an empty value for an option that does not allow empty
- /// values.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let res = Command::new("prog")
- /// .arg(Arg::new("color")
- /// .takes_value(true)
- /// .forbid_empty_values(true)
- /// .long("color"))
- /// .try_get_matches_from(vec!["prog", "--color="]);
- /// assert!(res.is_err());
- /// assert_eq!(res.unwrap_err().kind(), ErrorKind::EmptyValue);
- /// ```
- EmptyValue,
-
- /// Occurs when the user doesn't use equals for an option that requires equal
- /// sign to provide values.
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let res = Command::new("prog")
- /// .arg(Arg::new("color")
- /// .takes_value(true)
- /// .require_equals(true)
- /// .long("color"))
- /// .try_get_matches_from(vec!["prog", "--color", "red"]);
- /// assert!(res.is_err());
- /// assert_eq!(res.unwrap_err().kind(), ErrorKind::NoEquals);
- /// ```
- NoEquals,
-
- /// Occurs when the user provides a value for an argument with a custom validation and the
- /// value fails that validation.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// fn is_numeric(val: &str) -> Result<(), String> {
- /// match val.parse::<i64>() {
- /// Ok(..) => Ok(()),
- /// Err(..) => Err(String::from("Value wasn't a number!")),
- /// }
- /// }
- ///
- /// let result = Command::new("prog")
- /// .arg(Arg::new("num")
- /// .validator(is_numeric))
- /// .try_get_matches_from(vec!["prog", "NotANumber"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::ValueValidation);
- /// ```
- ValueValidation,
-
- /// Occurs when a user provides more values for an argument than were defined by setting
- /// [`Arg::max_values`].
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("arg")
- /// .max_values(2))
- /// .try_get_matches_from(vec!["prog", "too", "many", "values"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::TooManyValues);
- /// ```
- /// [`Arg::max_values`]: crate::Arg::max_values()
- TooManyValues,
-
- /// Occurs when the user provides fewer values for an argument than were defined by setting
- /// [`Arg::min_values`].
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("some_opt")
- /// .long("opt")
- /// .min_values(3))
- /// .try_get_matches_from(vec!["prog", "--opt", "too", "few"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::TooFewValues);
- /// ```
- /// [`Arg::min_values`]: crate::Arg::min_values()
- TooFewValues,
-
- /// Occurs when a user provides more occurrences for an argument than were defined by setting
- /// [`Arg::max_occurrences`].
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("verbosity")
- /// .short('v')
- /// .max_occurrences(2))
- /// .try_get_matches_from(vec!["prog", "-vvv"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::TooManyOccurrences);
- /// ```
- /// [`Arg::max_occurrences`]: crate::Arg::max_occurrences()
- TooManyOccurrences,
-
- /// Occurs when the user provides a different number of values for an argument than what's
- /// been defined by setting [`Arg::number_of_values`] or than was implicitly set by
- /// [`Arg::value_names`].
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("some_opt")
- /// .long("opt")
- /// .takes_value(true)
- /// .number_of_values(2))
- /// .try_get_matches_from(vec!["prog", "--opt", "wrong"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::WrongNumberOfValues);
- /// ```
- ///
- /// [`Arg::number_of_values`]: crate::Arg::number_of_values()
- /// [`Arg::value_names`]: crate::Arg::value_names()
- WrongNumberOfValues,
-
- /// Occurs when the user provides two values which conflict with each other and can't be used
- /// together.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("debug")
- /// .long("debug")
- /// .conflicts_with("color"))
- /// .arg(Arg::new("color")
- /// .long("color"))
- /// .try_get_matches_from(vec!["prog", "--debug", "--color"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::ArgumentConflict);
- /// ```
- ArgumentConflict,
-
- /// Occurs when the user does not provide one or more required arguments.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("debug")
- /// .required(true))
- /// .try_get_matches_from(vec!["prog"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::MissingRequiredArgument);
- /// ```
- MissingRequiredArgument,
-
- /// Occurs when a subcommand is required (as defined by [`Command::subcommand_required`]),
- /// but the user does not provide one.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, ErrorKind};
- /// let err = Command::new("prog")
- /// .subcommand_required(true)
- /// .subcommand(Command::new("test"))
- /// .try_get_matches_from(vec![
- /// "myprog",
- /// ]);
- /// assert!(err.is_err());
- /// assert_eq!(err.unwrap_err().kind(), ErrorKind::MissingSubcommand);
- /// # ;
- /// ```
- ///
- /// [`Command::subcommand_required`]: crate::Command::subcommand_required
- MissingSubcommand,
-
- /// Occurs when the user provides multiple values to an argument which doesn't allow that.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .arg(Arg::new("debug")
- /// .long("debug")
- /// .multiple_occurrences(false))
- /// .try_get_matches_from(vec!["prog", "--debug", "--debug"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::UnexpectedMultipleUsage);
- /// ```
- UnexpectedMultipleUsage,
-
- /// Occurs when the user provides a value containing invalid UTF-8.
- ///
- /// To allow arbitrary data
- /// - Set [`Arg::allow_invalid_utf8`] for argument values
- /// - Set [`Command::allow_invalid_utf8_for_external_subcommands`] for external-subcommand
- /// values
- ///
- /// # Platform Specific
- ///
- /// Non-Windows platforms only (such as Linux, Unix, OSX, etc.)
- ///
- /// # Examples
- ///
- #[cfg_attr(not(unix), doc = " ```ignore")]
- #[cfg_attr(unix, doc = " ```")]
- /// # use clap::{Command, Arg, ErrorKind};
- /// # use std::os::unix::ffi::OsStringExt;
- /// # use std::ffi::OsString;
- /// let result = Command::new("prog")
- /// .arg(Arg::new("utf8")
- /// .short('u')
- /// .takes_value(true))
- /// .try_get_matches_from(vec![OsString::from("myprog"),
- /// OsString::from("-u"),
- /// OsString::from_vec(vec![0xE9])]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::InvalidUtf8);
- /// ```
- ///
- /// [`Arg::allow_invalid_utf8`]: crate::Arg::allow_invalid_utf8
- /// [`Command::allow_invalid_utf8_for_external_subcommands`]: crate::Command::allow_invalid_utf8_for_external_subcommands
- InvalidUtf8,
-
- /// Not a true "error" as it means `--help` or similar was used.
- /// The help message will be sent to `stdout`.
- ///
- /// **Note**: If the help is displayed due to an error (such as missing subcommands) it will
- /// be sent to `stderr` instead of `stdout`.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .try_get_matches_from(vec!["prog", "--help"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::DisplayHelp);
- /// ```
- DisplayHelp,
-
- /// Occurs when either an argument or a [`Subcommand`] is required, as defined by
- /// [`Command::arg_required_else_help`] , but the user did not provide
- /// one.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind, };
- /// let result = Command::new("prog")
- /// .arg_required_else_help(true)
- /// .subcommand(Command::new("config")
- /// .about("Used for configuration")
- /// .arg(Arg::new("config_file")
- /// .help("The configuration file to use")))
- /// .try_get_matches_from(vec!["prog"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand);
- /// ```
- ///
- /// [`Subcommand`]: crate::Subcommand
- /// [`Command::arg_required_else_help`]: crate::Command::arg_required_else_help
- DisplayHelpOnMissingArgumentOrSubcommand,
-
- /// Not a true "error" as it means `--version` or similar was used.
- /// The message will be sent to `stdout`.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # use clap::{Command, Arg, ErrorKind};
- /// let result = Command::new("prog")
- /// .version("3.0")
- /// .try_get_matches_from(vec!["prog", "--version"]);
- /// assert!(result.is_err());
- /// assert_eq!(result.unwrap_err().kind(), ErrorKind::DisplayVersion);
- /// ```
- DisplayVersion,
-
- /// Occurs when using the [`ArgMatches::value_of_t`] and friends to convert an argument value
- /// into type `T`, but the argument you requested wasn't used. I.e. you asked for an argument
- /// with name `config` to be converted, but `config` wasn't used by the user.
- ///
- /// [`ArgMatches::value_of_t`]: crate::ArgMatches::value_of_t()
- ArgumentNotFound,
-
- /// Represents an [I/O error].
- /// Can occur when writing to `stderr` or `stdout` or reading a configuration file.
- ///
- /// [I/O error]: std::io::Error
- Io,
-
- /// Represents a [Format error] (which is a part of [`Display`]).
- /// Typically caused by writing to `stderr` or `stdout`.
- ///
- /// [`Display`]: std::fmt::Display
- /// [Format error]: std::fmt::Error
- Format,
-}
-
-impl ErrorKind {
- /// End-user description of the error case, where relevant
- pub fn as_str(self) -> Option<&'static str> {
- match self {
- Self::InvalidValue => Some("One of the values isn't valid for an argument"),
- Self::UnknownArgument => {
- Some("Found an argument which wasn't expected or isn't valid in this context")
- }
- Self::InvalidSubcommand => Some("A subcommand wasn't recognized"),
- Self::UnrecognizedSubcommand => Some("A subcommand wasn't recognized"),
- Self::EmptyValue => Some("An argument requires a value but none was supplied"),
- Self::NoEquals => Some("Equal is needed when assigning values to one of the arguments"),
- Self::ValueValidation => Some("Invalid for for one of the arguments"),
- Self::TooManyValues => Some("An argument received an unexpected value"),
- Self::TooFewValues => Some("An argument requires more values"),
- Self::TooManyOccurrences => Some("An argument occurred too many times"),
- Self::WrongNumberOfValues => Some("An argument received too many or too few values"),
- Self::ArgumentConflict => {
- Some("An argument cannot be used with one or more of the other specified arguments")
- }
- Self::MissingRequiredArgument => {
- Some("One or more required arguments were not provided")
- }
- Self::MissingSubcommand => Some("A subcommand is required but one was not provided"),
- Self::UnexpectedMultipleUsage => {
- Some("An argument was provided more than once but cannot be used multiple times")
- }
- Self::InvalidUtf8 => Some("Invalid UTF-8 was detected in one or more arguments"),
- Self::DisplayHelp => None,
- Self::DisplayHelpOnMissingArgumentOrSubcommand => None,
- Self::DisplayVersion => None,
- Self::ArgumentNotFound => Some("An argument wasn't found"),
- Self::Io => None,
- Self::Format => None,
- }
- }
-}
-
-impl std::fmt::Display for ErrorKind {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- self.as_str().unwrap_or_default().fmt(f)
- }
-}
diff --git a/vendor/clap/src/error/mod.rs b/vendor/clap/src/error/mod.rs
deleted file mode 100644
index df9a84c56..000000000
--- a/vendor/clap/src/error/mod.rs
+++ /dev/null
@@ -1,1158 +0,0 @@
-//! Error reporting
-#![allow(deprecated)]
-
-// Std
-use std::{
- borrow::Cow,
- convert::From,
- error,
- fmt::{self, Debug, Display, Formatter},
- io::{self, BufRead},
- result::Result as StdResult,
-};
-
-// Internal
-use crate::output::fmt::Colorizer;
-use crate::output::fmt::Stream;
-use crate::parser::features::suggestions;
-use crate::util::{color::ColorChoice, safe_exit, SUCCESS_CODE, USAGE_CODE};
-use crate::AppSettings;
-use crate::Command;
-
-mod context;
-mod kind;
-
-pub use context::ContextKind;
-pub use context::ContextValue;
-pub use kind::ErrorKind;
-
-/// Short hand for [`Result`] type
-///
-/// [`Result`]: std::result::Result
-pub type Result<T, E = Error> = StdResult<T, E>;
-
-/// Command Line Argument Parser Error
-///
-/// See [`Command::error`] to create an error.
-///
-/// [`Command::error`]: crate::Command::error
-#[derive(Debug)]
-pub struct Error {
- inner: Box<ErrorInner>,
- /// Deprecated, replaced with [`Error::kind()`]
- #[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.1.0", note = "Replaced with `Error::kind()`")
- )]
- pub kind: ErrorKind,
- /// Deprecated, replaced with [`Error::context()`]
- #[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.1.0", note = "Replaced with `Error::context()`")
- )]
- pub info: Vec<String>,
-}
-
-#[derive(Debug)]
-struct ErrorInner {
- kind: ErrorKind,
- context: Vec<(ContextKind, ContextValue)>,
- message: Option<Message>,
- source: Option<Box<dyn error::Error + Send + Sync>>,
- help_flag: Option<&'static str>,
- color_when: ColorChoice,
- wait_on_exit: bool,
- backtrace: Option<Backtrace>,
-}
-
-impl Error {
- /// Create an unformatted error
- ///
- /// This is for you need to pass the error up to
- /// a place that has access to the `Command` at which point you can call [`Error::format`].
- ///
- /// Prefer [`Command::error`] for generating errors.
- ///
- /// [`Command::error`]: crate::Command::error
- pub fn raw(kind: ErrorKind, message: impl std::fmt::Display) -> Self {
- Self::new(kind).set_message(message.to_string())
- }
-
- /// Format the existing message with the Command's context
- #[must_use]
- pub fn format(mut self, cmd: &mut Command) -> Self {
- cmd._build_self();
- let usage = cmd.render_usage();
- if let Some(message) = self.inner.message.as_mut() {
- message.format(cmd, usage);
- }
- self.with_cmd(cmd)
- }
-
- /// Type of error for programmatic processing
- pub fn kind(&self) -> ErrorKind {
- self.inner.kind
- }
-
- /// Additional information to further qualify the error
- pub fn context(&self) -> impl Iterator<Item = (ContextKind, &ContextValue)> {
- self.inner.context.iter().map(|(k, v)| (*k, v))
- }
-
- /// Should the message be written to `stdout` or not?
- #[inline]
- pub fn use_stderr(&self) -> bool {
- self.stream() == Stream::Stderr
- }
-
- pub(crate) fn stream(&self) -> Stream {
- match self.kind() {
- ErrorKind::DisplayHelp | ErrorKind::DisplayVersion => Stream::Stdout,
- _ => Stream::Stderr,
- }
- }
-
- /// Prints the error and exits.
- ///
- /// Depending on the error kind, this either prints to `stderr` and exits with a status of `2`
- /// or prints to `stdout` and exits with a status of `0`.
- pub fn exit(&self) -> ! {
- if self.use_stderr() {
- // Swallow broken pipe errors
- let _ = self.print();
-
- if self.inner.wait_on_exit {
- wlnerr!("\nPress [ENTER] / [RETURN] to continue...");
- let mut s = String::new();
- let i = io::stdin();
- i.lock().read_line(&mut s).unwrap();
- }
-
- safe_exit(USAGE_CODE);
- }
-
- // Swallow broken pipe errors
- let _ = self.print();
- safe_exit(SUCCESS_CODE)
- }
-
- /// Prints formatted and colored error to `stdout` or `stderr` according to its error kind
- ///
- /// # Example
- /// ```no_run
- /// use clap::Command;
- ///
- /// match Command::new("Command").try_get_matches() {
- /// Ok(matches) => {
- /// // do_something
- /// },
- /// Err(err) => {
- /// err.print().expect("Error writing Error");
- /// // do_something
- /// },
- /// };
- /// ```
- pub fn print(&self) -> io::Result<()> {
- self.formatted().print()
- }
-
- /// Deprecated, replaced with [`Command::error`]
- ///
- /// [`Command::error`]: crate::Command::error
- #[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `Command::error`")
- )]
- #[doc(hidden)]
- pub fn with_description(description: String, kind: ErrorKind) -> Self {
- Error::raw(kind, description)
- }
-
- fn new(kind: ErrorKind) -> Self {
- Self {
- inner: Box::new(ErrorInner {
- kind,
- context: Vec::new(),
- message: None,
- source: None,
- help_flag: None,
- color_when: ColorChoice::Never,
- wait_on_exit: false,
- backtrace: Backtrace::new(),
- }),
- kind,
- info: vec![],
- }
- }
-
- #[inline(never)]
- fn for_app(kind: ErrorKind, cmd: &Command, colorizer: Colorizer, info: Vec<String>) -> Self {
- Self::new(kind)
- .set_message(colorizer)
- .with_cmd(cmd)
- .set_info(info)
- }
-
- pub(crate) fn with_cmd(self, cmd: &Command) -> Self {
- self.set_wait_on_exit(cmd.is_set(AppSettings::WaitOnError))
- .set_color(cmd.get_color())
- .set_help_flag(get_help_flag(cmd))
- }
-
- pub(crate) fn set_message(mut self, message: impl Into<Message>) -> Self {
- self.inner.message = Some(message.into());
- self
- }
-
- pub(crate) fn set_info(mut self, info: Vec<String>) -> Self {
- self.info = info;
- self
- }
-
- pub(crate) fn set_source(mut self, source: Box<dyn error::Error + Send + Sync>) -> Self {
- self.inner.source = Some(source);
- self
- }
-
- pub(crate) fn set_color(mut self, color_when: ColorChoice) -> Self {
- self.inner.color_when = color_when;
- self
- }
-
- pub(crate) fn set_help_flag(mut self, help_flag: Option<&'static str>) -> Self {
- self.inner.help_flag = help_flag;
- self
- }
-
- pub(crate) fn set_wait_on_exit(mut self, yes: bool) -> Self {
- self.inner.wait_on_exit = yes;
- self
- }
-
- /// Does not verify if `ContextKind` is already present
- #[inline(never)]
- pub(crate) fn insert_context_unchecked(
- mut self,
- kind: ContextKind,
- value: ContextValue,
- ) -> Self {
- self.inner.context.push((kind, value));
- self
- }
-
- /// Does not verify if `ContextKind` is already present
- #[inline(never)]
- pub(crate) fn extend_context_unchecked<const N: usize>(
- mut self,
- context: [(ContextKind, ContextValue); N],
- ) -> Self {
- self.inner.context.extend(context);
- self
- }
-
- #[inline(never)]
- fn get_context(&self, kind: ContextKind) -> Option<&ContextValue> {
- self.inner
- .context
- .iter()
- .find_map(|(k, v)| (*k == kind).then(|| v))
- }
-
- pub(crate) fn display_help(cmd: &Command, colorizer: Colorizer) -> Self {
- Self::for_app(ErrorKind::DisplayHelp, cmd, colorizer, vec![])
- }
-
- pub(crate) fn display_help_error(cmd: &Command, colorizer: Colorizer) -> Self {
- Self::for_app(
- ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand,
- cmd,
- colorizer,
- vec![],
- )
- }
-
- pub(crate) fn display_version(cmd: &Command, colorizer: Colorizer) -> Self {
- Self::for_app(ErrorKind::DisplayVersion, cmd, colorizer, vec![])
- }
-
- pub(crate) fn argument_conflict(
- cmd: &Command,
- arg: String,
- mut others: Vec<String>,
- usage: String,
- ) -> Self {
- let info = others.clone();
- let others = match others.len() {
- 0 => ContextValue::None,
- 1 => ContextValue::String(others.pop().unwrap()),
- _ => ContextValue::Strings(others),
- };
- Self::new(ErrorKind::ArgumentConflict)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::PriorArg, others),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn empty_value(cmd: &Command, good_vals: &[&str], arg: String) -> Self {
- let info = vec![arg.clone()];
- let mut err = Self::new(ErrorKind::EmptyValue)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([(ContextKind::InvalidArg, ContextValue::String(arg))]);
- if !good_vals.is_empty() {
- err = err.insert_context_unchecked(
- ContextKind::ValidValue,
- ContextValue::Strings(good_vals.iter().map(|s| (*s).to_owned()).collect()),
- );
- }
- err
- }
-
- pub(crate) fn no_equals(cmd: &Command, arg: String, usage: String) -> Self {
- let info = vec![arg.clone()];
- Self::new(ErrorKind::NoEquals)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn invalid_value(
- cmd: &Command,
- bad_val: String,
- good_vals: &[&str],
- arg: String,
- ) -> Self {
- let mut info = vec![arg.clone(), bad_val.clone()];
- info.extend(good_vals.iter().map(|s| (*s).to_owned()));
-
- let suggestion = suggestions::did_you_mean(&bad_val, good_vals.iter()).pop();
- let mut err = Self::new(ErrorKind::InvalidValue)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::InvalidValue, ContextValue::String(bad_val)),
- (
- ContextKind::ValidValue,
- ContextValue::Strings(good_vals.iter().map(|s| (*s).to_owned()).collect()),
- ),
- ]);
- if let Some(suggestion) = suggestion {
- err = err.insert_context_unchecked(
- ContextKind::SuggestedValue,
- ContextValue::String(suggestion),
- );
- }
- err
- }
-
- pub(crate) fn invalid_subcommand(
- cmd: &Command,
- subcmd: String,
- did_you_mean: String,
- name: String,
- usage: String,
- ) -> Self {
- let info = vec![subcmd.clone()];
- let suggestion = format!("{} -- {}", name, subcmd);
- Self::new(ErrorKind::InvalidSubcommand)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidSubcommand, ContextValue::String(subcmd)),
- (
- ContextKind::SuggestedSubcommand,
- ContextValue::String(did_you_mean),
- ),
- (
- ContextKind::SuggestedCommand,
- ContextValue::String(suggestion),
- ),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn unrecognized_subcommand(cmd: &Command, subcmd: String, usage: String) -> Self {
- let info = vec![subcmd.clone()];
- Self::new(ErrorKind::UnrecognizedSubcommand)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidSubcommand, ContextValue::String(subcmd)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn missing_required_argument(
- cmd: &Command,
- required: Vec<String>,
- usage: String,
- ) -> Self {
- let info = required.clone();
- Self::new(ErrorKind::MissingRequiredArgument)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::Strings(required)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn missing_subcommand(cmd: &Command, name: String, usage: String) -> Self {
- let info = vec![];
- Self::new(ErrorKind::MissingSubcommand)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidSubcommand, ContextValue::String(name)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn invalid_utf8(cmd: &Command, usage: String) -> Self {
- let info = vec![];
- Self::new(ErrorKind::InvalidUtf8)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([(ContextKind::Usage, ContextValue::String(usage))])
- }
-
- pub(crate) fn too_many_occurrences(
- cmd: &Command,
- arg: String,
- max_occurs: usize,
- curr_occurs: usize,
- usage: String,
- ) -> Self {
- let info = vec![arg.clone(), curr_occurs.to_string(), max_occurs.to_string()];
- Self::new(ErrorKind::TooManyOccurrences)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (
- ContextKind::MaxOccurrences,
- ContextValue::Number(max_occurs as isize),
- ),
- (
- ContextKind::ActualNumValues,
- ContextValue::Number(curr_occurs as isize),
- ),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn too_many_values(cmd: &Command, val: String, arg: String, usage: String) -> Self {
- let info = vec![arg.clone(), val.clone()];
- Self::new(ErrorKind::TooManyValues)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::InvalidValue, ContextValue::String(val)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn too_few_values(
- cmd: &Command,
- arg: String,
- min_vals: usize,
- curr_vals: usize,
- usage: String,
- ) -> Self {
- let info = vec![arg.clone(), curr_vals.to_string(), min_vals.to_string()];
- Self::new(ErrorKind::TooFewValues)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (
- ContextKind::MinValues,
- ContextValue::Number(min_vals as isize),
- ),
- (
- ContextKind::ActualNumValues,
- ContextValue::Number(curr_vals as isize),
- ),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn value_validation(
- arg: String,
- val: String,
- err: Box<dyn error::Error + Send + Sync>,
- ) -> Self {
- let info = vec![arg.clone(), val.to_string(), err.to_string()];
- Self::new(ErrorKind::ValueValidation)
- .set_info(info)
- .set_source(err)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::InvalidValue, ContextValue::String(val)),
- ])
- }
-
- pub(crate) fn wrong_number_of_values(
- cmd: &Command,
- arg: String,
- num_vals: usize,
- curr_vals: usize,
- usage: String,
- ) -> Self {
- let info = vec![arg.clone(), curr_vals.to_string(), num_vals.to_string()];
- Self::new(ErrorKind::WrongNumberOfValues)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (
- ContextKind::ExpectedNumValues,
- ContextValue::Number(num_vals as isize),
- ),
- (
- ContextKind::ActualNumValues,
- ContextValue::Number(curr_vals as isize),
- ),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn unexpected_multiple_usage(cmd: &Command, arg: String, usage: String) -> Self {
- let info = vec![arg.clone()];
- Self::new(ErrorKind::UnexpectedMultipleUsage)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn unknown_argument(
- cmd: &Command,
- arg: String,
- did_you_mean: Option<(String, Option<String>)>,
- usage: String,
- ) -> Self {
- let info = vec![arg.clone()];
- let mut err = Self::new(ErrorKind::UnknownArgument)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ]);
- if let Some((flag, sub)) = did_you_mean {
- err = err.insert_context_unchecked(
- ContextKind::SuggestedArg,
- ContextValue::String(format!("--{}", flag)),
- );
- if let Some(sub) = sub {
- err = err.insert_context_unchecked(
- ContextKind::SuggestedSubcommand,
- ContextValue::String(sub),
- );
- }
- }
- err
- }
-
- pub(crate) fn unnecessary_double_dash(cmd: &Command, arg: String, usage: String) -> Self {
- let info = vec![arg.clone()];
- Self::new(ErrorKind::UnknownArgument)
- .with_cmd(cmd)
- .set_info(info)
- .extend_context_unchecked([
- (ContextKind::InvalidArg, ContextValue::String(arg)),
- (ContextKind::TrailingArg, ContextValue::Bool(true)),
- (ContextKind::Usage, ContextValue::String(usage)),
- ])
- }
-
- pub(crate) fn argument_not_found_auto(arg: String) -> Self {
- let info = vec![arg.clone()];
- Self::new(ErrorKind::ArgumentNotFound)
- .set_info(info)
- .extend_context_unchecked([(ContextKind::InvalidArg, ContextValue::String(arg))])
- }
-
- fn formatted(&self) -> Cow<'_, Colorizer> {
- if let Some(message) = self.inner.message.as_ref() {
- message.formatted()
- } else {
- let mut c = Colorizer::new(self.stream(), self.inner.color_when);
-
- start_error(&mut c);
-
- if !self.write_dynamic_context(&mut c) {
- if let Some(msg) = self.kind().as_str() {
- c.none(msg.to_owned());
- } else if let Some(source) = self.inner.source.as_ref() {
- c.none(source.to_string());
- } else {
- c.none("Unknown cause");
- }
- }
-
- let usage = self.get_context(ContextKind::Usage);
- if let Some(ContextValue::String(usage)) = usage {
- put_usage(&mut c, usage);
- }
-
- try_help(&mut c, self.inner.help_flag);
-
- Cow::Owned(c)
- }
- }
-
- #[must_use]
- fn write_dynamic_context(&self, c: &mut Colorizer) -> bool {
- match self.kind() {
- ErrorKind::ArgumentConflict => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let prior_arg = self.get_context(ContextKind::PriorArg);
- if let (Some(ContextValue::String(invalid_arg)), Some(prior_arg)) =
- (invalid_arg, prior_arg)
- {
- c.none("The argument '");
- c.warning(invalid_arg);
- c.none("' cannot be used with");
-
- match prior_arg {
- ContextValue::Strings(values) => {
- c.none(":");
- for v in values {
- c.none("\n ");
- c.warning(&**v);
- }
- }
- ContextValue::String(value) => {
- c.none(" '");
- c.warning(value);
- c.none("'");
- }
- _ => {
- c.none(" one or more of the other specified arguments");
- }
- }
- true
- } else {
- false
- }
- }
- ErrorKind::EmptyValue => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
- c.none("The argument '");
- c.warning(invalid_arg);
- c.none("' requires a value but none was supplied");
-
- let possible_values = self.get_context(ContextKind::ValidValue);
- if let Some(ContextValue::Strings(possible_values)) = possible_values {
- c.none("\n\t[possible values: ");
- if let Some((last, elements)) = possible_values.split_last() {
- for v in elements {
- c.good(escape(v));
- c.none(", ");
- }
- c.good(escape(last));
- }
- c.none("]");
- }
- true
- } else {
- false
- }
- }
- ErrorKind::NoEquals => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
- c.none("Equal sign is needed when assigning values to '");
- c.warning(invalid_arg);
- c.none("'.");
- true
- } else {
- false
- }
- }
- ErrorKind::InvalidValue => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let invalid_value = self.get_context(ContextKind::InvalidValue);
- if let (
- Some(ContextValue::String(invalid_arg)),
- Some(ContextValue::String(invalid_value)),
- ) = (invalid_arg, invalid_value)
- {
- c.none(quote(invalid_value));
- c.none(" isn't a valid value for '");
- c.warning(invalid_arg);
- c.none("'");
-
- let possible_values = self.get_context(ContextKind::ValidValue);
- if let Some(ContextValue::Strings(possible_values)) = possible_values {
- c.none("\n\t[possible values: ");
- if let Some((last, elements)) = possible_values.split_last() {
- for v in elements {
- c.good(escape(v));
- c.none(", ");
- }
- c.good(escape(last));
- }
- c.none("]");
- }
-
- let suggestion = self.get_context(ContextKind::SuggestedValue);
- if let Some(ContextValue::String(suggestion)) = suggestion {
- c.none("\n\n\tDid you mean ");
- c.good(quote(suggestion));
- c.none("?");
- }
- true
- } else {
- false
- }
- }
- ErrorKind::InvalidSubcommand => {
- let invalid_sub = self.get_context(ContextKind::InvalidSubcommand);
- if let Some(ContextValue::String(invalid_sub)) = invalid_sub {
- c.none("The subcommand '");
- c.warning(invalid_sub);
- c.none("' wasn't recognized");
-
- let valid_sub = self.get_context(ContextKind::SuggestedSubcommand);
- if let Some(ContextValue::String(valid_sub)) = valid_sub {
- c.none("\n\n\tDid you mean ");
- c.good(valid_sub);
- c.none("?");
- }
-
- let suggestion = self.get_context(ContextKind::SuggestedCommand);
- if let Some(ContextValue::String(suggestion)) = suggestion {
- c.none(
- "\n\nIf you believe you received this message in error, try re-running with '",
- );
- c.good(suggestion);
- c.none("'");
- }
- true
- } else {
- false
- }
- }
- ErrorKind::UnrecognizedSubcommand => {
- let invalid_sub = self.get_context(ContextKind::InvalidSubcommand);
- if let Some(ContextValue::String(invalid_sub)) = invalid_sub {
- c.none("The subcommand '");
- c.warning(invalid_sub);
- c.none("' wasn't recognized");
- true
- } else {
- false
- }
- }
- ErrorKind::MissingRequiredArgument => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::Strings(invalid_arg)) = invalid_arg {
- c.none("The following required arguments were not provided:");
- for v in invalid_arg {
- c.none("\n ");
- c.good(&**v);
- }
- true
- } else {
- false
- }
- }
- ErrorKind::MissingSubcommand => {
- let invalid_sub = self.get_context(ContextKind::InvalidSubcommand);
- if let Some(ContextValue::String(invalid_sub)) = invalid_sub {
- c.none("'");
- c.warning(invalid_sub);
- c.none("' requires a subcommand but one was not provided");
- true
- } else {
- false
- }
- }
- ErrorKind::InvalidUtf8 => false,
- ErrorKind::TooManyOccurrences => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let actual_num_occurs = self.get_context(ContextKind::ActualNumOccurrences);
- let max_occurs = self.get_context(ContextKind::MaxOccurrences);
- if let (
- Some(ContextValue::String(invalid_arg)),
- Some(ContextValue::Number(actual_num_occurs)),
- Some(ContextValue::Number(max_occurs)),
- ) = (invalid_arg, actual_num_occurs, max_occurs)
- {
- let were_provided = Error::singular_or_plural(*actual_num_occurs as usize);
- c.none("The argument '");
- c.warning(invalid_arg);
- c.none("' allows at most ");
- c.warning(max_occurs.to_string());
- c.none(" occurrences but ");
- c.warning(actual_num_occurs.to_string());
- c.none(were_provided);
- true
- } else {
- false
- }
- }
- ErrorKind::TooManyValues => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let invalid_value = self.get_context(ContextKind::InvalidValue);
- if let (
- Some(ContextValue::String(invalid_arg)),
- Some(ContextValue::String(invalid_value)),
- ) = (invalid_arg, invalid_value)
- {
- c.none("The value '");
- c.warning(invalid_value);
- c.none("' was provided to '");
- c.warning(invalid_arg);
- c.none("' but it wasn't expecting any more values");
- true
- } else {
- false
- }
- }
- ErrorKind::TooFewValues => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let actual_num_values = self.get_context(ContextKind::ActualNumValues);
- let min_values = self.get_context(ContextKind::MinValues);
- if let (
- Some(ContextValue::String(invalid_arg)),
- Some(ContextValue::Number(actual_num_values)),
- Some(ContextValue::Number(min_values)),
- ) = (invalid_arg, actual_num_values, min_values)
- {
- let were_provided = Error::singular_or_plural(*actual_num_values as usize);
- c.none("The argument '");
- c.warning(invalid_arg);
- c.none("' requires at least ");
- c.warning(min_values.to_string());
- c.none(" values but only ");
- c.warning(actual_num_values.to_string());
- c.none(were_provided);
- true
- } else {
- false
- }
- }
- ErrorKind::ValueValidation => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let invalid_value = self.get_context(ContextKind::InvalidValue);
- if let (
- Some(ContextValue::String(invalid_arg)),
- Some(ContextValue::String(invalid_value)),
- ) = (invalid_arg, invalid_value)
- {
- c.none("Invalid value ");
- c.warning(quote(invalid_value));
- c.none(" for '");
- c.warning(invalid_arg);
- if let Some(source) = self.inner.source.as_deref() {
- c.none("': ");
- c.none(source.to_string());
- } else {
- c.none("'");
- }
- true
- } else {
- false
- }
- }
- ErrorKind::WrongNumberOfValues => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- let actual_num_values = self.get_context(ContextKind::ActualNumValues);
- let num_values = self.get_context(ContextKind::ExpectedNumValues);
- if let (
- Some(ContextValue::String(invalid_arg)),
- Some(ContextValue::Number(actual_num_values)),
- Some(ContextValue::Number(num_values)),
- ) = (invalid_arg, actual_num_values, num_values)
- {
- let were_provided = Error::singular_or_plural(*actual_num_values as usize);
- c.none("The argument '");
- c.warning(invalid_arg);
- c.none("' requires ");
- c.warning(num_values.to_string());
- c.none(" values, but ");
- c.warning(actual_num_values.to_string());
- c.none(were_provided);
- true
- } else {
- false
- }
- }
- ErrorKind::UnexpectedMultipleUsage => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
- c.none("The argument '");
- c.warning(invalid_arg.to_string());
- c.none("' was provided more than once, but cannot be used multiple times");
- true
- } else {
- false
- }
- }
- ErrorKind::UnknownArgument => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
- c.none("Found argument '");
- c.warning(invalid_arg.to_string());
- c.none("' which wasn't expected, or isn't valid in this context");
-
- let valid_sub = self.get_context(ContextKind::SuggestedSubcommand);
- let valid_arg = self.get_context(ContextKind::SuggestedArg);
- match (valid_sub, valid_arg) {
- (
- Some(ContextValue::String(valid_sub)),
- Some(ContextValue::String(valid_arg)),
- ) => {
- c.none("\n\n\tDid you mean ");
- c.none("to put '");
- c.good(valid_arg);
- c.none("' after the subcommand '");
- c.good(valid_sub);
- c.none("'?");
- }
- (None, Some(ContextValue::String(valid_arg))) => {
- c.none("\n\n\tDid you mean '");
- c.good(valid_arg);
- c.none("'?");
- }
- (_, _) => {}
- }
-
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
- if invalid_arg.starts_with('-') {
- c.none(format!(
- "\n\n\tIf you tried to supply `{}` as a value rather than a flag, use `-- {}`",
- invalid_arg, invalid_arg
- ));
- }
-
- let trailing_arg = self.get_context(ContextKind::TrailingArg);
- if trailing_arg == Some(&ContextValue::Bool(true)) {
- c.none(format!(
- "\n\n\tIf you tried to supply `{}` as a subcommand, remove the '--' before it.",
- invalid_arg
- ));
- }
- }
- true
- } else {
- false
- }
- }
- ErrorKind::ArgumentNotFound => {
- let invalid_arg = self.get_context(ContextKind::InvalidArg);
- if let Some(ContextValue::String(invalid_arg)) = invalid_arg {
- c.none("The argument '");
- c.warning(invalid_arg.to_string());
- c.none("' wasn't found");
- true
- } else {
- false
- }
- }
- ErrorKind::DisplayHelp
- | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
- | ErrorKind::DisplayVersion
- | ErrorKind::Io
- | ErrorKind::Format => false,
- }
- }
-
- /// Returns the singular or plural form on the verb to be based on the argument's value.
- fn singular_or_plural(n: usize) -> &'static str {
- if n > 1 {
- " were provided"
- } else {
- " was provided"
- }
- }
-}
-
-impl From<io::Error> for Error {
- fn from(e: io::Error) -> Self {
- Error::raw(ErrorKind::Io, e)
- }
-}
-
-impl From<fmt::Error> for Error {
- fn from(e: fmt::Error) -> Self {
- Error::raw(ErrorKind::Format, e)
- }
-}
-
-impl error::Error for Error {
- #[allow(trivial_casts)]
- fn source(&self) -> Option<&(dyn error::Error + 'static)> {
- self.inner.source.as_ref().map(|e| e.as_ref() as _)
- }
-}
-
-impl Display for Error {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- // Assuming `self.message` already has a trailing newline, from `try_help` or similar
- write!(f, "{}", self.formatted())?;
- if let Some(backtrace) = self.inner.backtrace.as_ref() {
- writeln!(f)?;
- writeln!(f, "Backtrace:")?;
- writeln!(f, "{}", backtrace)?;
- }
- Ok(())
- }
-}
-
-fn start_error(c: &mut Colorizer) {
- c.error("error:");
- c.none(" ");
-}
-
-fn put_usage(c: &mut Colorizer, usage: impl Into<String>) {
- c.none("\n\n");
- c.none(usage);
-}
-
-fn get_help_flag(cmd: &Command) -> Option<&'static str> {
- if !cmd.is_disable_help_flag_set() {
- Some("--help")
- } else if cmd.has_subcommands() && !cmd.is_disable_help_subcommand_set() {
- Some("help")
- } else {
- None
- }
-}
-
-fn try_help(c: &mut Colorizer, help: Option<&str>) {
- if let Some(help) = help {
- c.none("\n\nFor more information try ");
- c.good(help);
- c.none("\n");
- } else {
- c.none("\n");
- }
-}
-
-fn quote(s: impl AsRef<str>) -> String {
- let s = s.as_ref();
- format!("{:?}", s)
-}
-
-fn escape(s: impl AsRef<str>) -> String {
- let s = s.as_ref();
- if s.contains(char::is_whitespace) {
- quote(s)
- } else {
- s.to_owned()
- }
-}
-
-#[derive(Clone, Debug)]
-pub(crate) enum Message {
- Raw(String),
- Formatted(Colorizer),
-}
-
-impl Message {
- fn format(&mut self, cmd: &Command, usage: String) {
- match self {
- Message::Raw(s) => {
- let mut c = Colorizer::new(Stream::Stderr, cmd.get_color());
-
- let mut message = String::new();
- std::mem::swap(s, &mut message);
- start_error(&mut c);
- c.none(message);
- put_usage(&mut c, usage);
- try_help(&mut c, get_help_flag(cmd));
- *self = Self::Formatted(c);
- }
- Message::Formatted(_) => {}
- }
- }
-
- fn formatted(&self) -> Cow<Colorizer> {
- match self {
- Message::Raw(s) => {
- let mut c = Colorizer::new(Stream::Stderr, ColorChoice::Never);
- start_error(&mut c);
- c.none(s);
- Cow::Owned(c)
- }
- Message::Formatted(c) => Cow::Borrowed(c),
- }
- }
-}
-
-impl From<String> for Message {
- fn from(inner: String) -> Self {
- Self::Raw(inner)
- }
-}
-
-impl From<Colorizer> for Message {
- fn from(inner: Colorizer) -> Self {
- Self::Formatted(inner)
- }
-}
-
-#[cfg(feature = "debug")]
-#[derive(Debug)]
-struct Backtrace(backtrace::Backtrace);
-
-#[cfg(feature = "debug")]
-impl Backtrace {
- fn new() -> Option<Self> {
- Some(Self(backtrace::Backtrace::new()))
- }
-}
-
-#[cfg(feature = "debug")]
-impl Display for Backtrace {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- // `backtrace::Backtrace` uses `Debug` instead of `Display`
- write!(f, "{:?}", self.0)
- }
-}
-
-#[cfg(not(feature = "debug"))]
-#[derive(Debug)]
-struct Backtrace;
-
-#[cfg(not(feature = "debug"))]
-impl Backtrace {
- fn new() -> Option<Self> {
- None
- }
-}
-
-#[cfg(not(feature = "debug"))]
-impl Display for Backtrace {
- fn fmt(&self, _: &mut Formatter) -> fmt::Result {
- Ok(())
- }
-}
-
-#[cfg(test)]
-mod tests {
- /// Check `clap::Error` impls Send and Sync.
- mod clap_error_impl_send_sync {
- use crate::Error;
- trait Foo: std::error::Error + Send + Sync + 'static {}
- impl Foo for Error {}
- }
-}
diff --git a/vendor/clap/src/lib.rs b/vendor/clap/src/lib.rs
deleted file mode 100644
index d9a97715f..000000000
--- a/vendor/clap/src/lib.rs
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright â“’ 2015-2016 Kevin B. Knapp and [`clap-rs` contributors](https://github.com/clap-rs/clap/graphs/contributors).
-// Licensed under the MIT license
-// (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such
-// notice may not be copied, modified, or distributed except according to those terms.
-
-#![cfg_attr(docsrs, feature(doc_auto_cfg))]
-#![doc(html_logo_url = "https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png")]
-#![cfg_attr(feature = "derive", doc = include_str!("../README.md"))]
-//! <https://github.com/clap-rs/clap>
-#![warn(
- missing_docs,
- missing_debug_implementations,
- missing_copy_implementations,
- trivial_casts,
- unused_allocation,
- trivial_numeric_casts,
- clippy::single_char_pattern
-)]
-#![forbid(unsafe_code)]
-// HACK https://github.com/rust-lang/rust-clippy/issues/7290
-#![allow(clippy::single_component_path_imports)]
-#![allow(clippy::branches_sharing_code)]
-// Doesn't allow for debug statements, etc to be unique
-#![allow(clippy::if_same_then_else)]
-
-#[cfg(not(feature = "std"))]
-compile_error!("`std` feature is currently required to build `clap`");
-
-pub use crate::builder::ArgAction;
-pub use crate::builder::Command;
-pub use crate::builder::{Arg, ArgGroup};
-pub use crate::error::Error;
-pub use crate::parser::ArgMatches;
-#[cfg(feature = "color")]
-pub use crate::util::color::ColorChoice;
-#[cfg(not(feature = "color"))]
-#[allow(unused_imports)]
-pub(crate) use crate::util::color::ColorChoice;
-
-pub use crate::derive::{Args, CommandFactory, FromArgMatches, Parser, Subcommand, ValueEnum};
-
-#[allow(deprecated)]
-pub use crate::builder::App;
-pub use crate::builder::{AppFlags, AppSettings, ArgFlags, ArgSettings, PossibleValue, ValueHint};
-pub use crate::error::{ErrorKind, Result};
-#[allow(deprecated)]
-pub use crate::parser::{Indices, OsValues, ValueSource, Values};
-
-#[cfg(feature = "yaml")]
-#[doc(hidden)]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Deprecated in Issue #3087, maybe clap::Parser would fit your use case?"
- )
-)]
-#[doc(hidden)]
-pub use yaml_rust::YamlLoader;
-
-#[cfg(feature = "derive")]
-#[doc(hidden)]
-pub use clap_derive::{self, *};
-
-/// Deprecated, replaced with [`CommandFactory`]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `CommandFactory`")
-)]
-pub use CommandFactory as IntoApp;
-/// Deprecated, replaced with [`Parser`]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `Parser`")
-)]
-#[doc(hidden)]
-pub use Parser as StructOpt;
-/// Deprecated, replaced with [`ValueEnum`]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.2.0", note = "Replaced with `ValueEnum`")
-)]
-pub use ValueEnum as ArgEnum;
-
-#[cfg(any(feature = "derive", feature = "cargo"))]
-#[doc(hidden)]
-pub use once_cell;
-
-#[macro_use]
-#[allow(missing_docs)]
-mod macros;
-
-mod derive;
-
-#[cfg(feature = "regex")]
-pub use crate::builder::RegexRef;
-
-pub mod builder;
-pub mod error;
-pub mod parser;
-
-mod mkeymap;
-mod output;
-mod util;
-
-const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \
- report at https://github.com/clap-rs/clap/issues";
-const INVALID_UTF8: &str = "unexpected invalid UTF-8 code point";
-
-/// Deprecated, replaced with [`Command::new`], unless you were looking for [Subcommand]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Replaced with `Command::new` unless you intended the `Subcommand` trait"
- )
-)]
-#[doc(hidden)]
-#[derive(Debug, Copy, Clone)]
-pub struct SubCommand {}
-
-#[allow(deprecated)]
-impl SubCommand {
- /// Deprecated, replaced with [`Command::new`].
- /// Did you mean Subcommand (lower-case c)?
- #[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `Command::new`")
- )]
- #[doc(hidden)]
- pub fn with_name<'help>(name: &str) -> App<'help> {
- Command::new(name)
- }
-
- /// Deprecated in [Issue #3087](https://github.com/clap-rs/clap/issues/3087), maybe [`clap::Parser`][crate::Parser] would fit your use case?
- #[cfg(feature = "yaml")]
- #[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Deprecated in Issue #3087, maybe clap::Parser would fit your use case?"
- )
- )]
- #[doc(hidden)]
- pub fn from_yaml(yaml: &yaml_rust::Yaml) -> App {
- #![allow(deprecated)]
- Command::from_yaml(yaml)
- }
-}
diff --git a/vendor/clap/src/macros.rs b/vendor/clap/src/macros.rs
deleted file mode 100644
index 0b671a37a..000000000
--- a/vendor/clap/src/macros.rs
+++ /dev/null
@@ -1,1062 +0,0 @@
-/// Deprecated in [Issue #3087](https://github.com/clap-rs/clap/issues/3087), maybe [`clap::Parser`][crate::Parser] would fit your use case?
-#[cfg(feature = "yaml")]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Deprecated in Issue #3087, maybe clap::Parser would fit your use case?"
- )
-)]
-#[doc(hidden)]
-#[macro_export]
-macro_rules! load_yaml {
- ($yaml:expr) => {
- &$crate::YamlLoader::load_from_str(include_str!($yaml)).expect("failed to load YAML file")
- [0]
- };
-}
-
-/// Deprecated, replaced with [`ArgMatches::value_of_t`][crate::ArgMatches::value_of_t]
-#[macro_export]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `ArgMatches::value_of_t`")
-)]
-#[doc(hidden)]
-macro_rules! value_t {
- ($m:ident, $v:expr, $t:ty) => {
- $crate::value_t!($m.value_of($v), $t)
- };
- ($m:ident.value_of($v:expr), $t:ty) => {
- $m.value_of_t::<$t>($v)
- };
-}
-
-/// Deprecated, replaced with [`ArgMatches::value_of_t_or_exit`][crate::ArgMatches::value_of_t_or_exit]
-#[macro_export]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Replaced with `ArgMatches::value_of_t_or_exit`"
- )
-)]
-#[doc(hidden)]
-macro_rules! value_t_or_exit {
- ($m:ident, $v:expr, $t:ty) => {
- value_t_or_exit!($m.value_of($v), $t)
- };
- ($m:ident.value_of($v:expr), $t:ty) => {
- $m.value_of_t_or_exit::<$t>($v)
- };
-}
-
-/// Deprecated, replaced with [`ArgMatches::values_of_t`][crate::ArgMatches::value_of_t]
-#[macro_export]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `ArgMatches::values_of_t`")
-)]
-#[doc(hidden)]
-macro_rules! values_t {
- ($m:ident, $v:expr, $t:ty) => {
- values_t!($m.values_of($v), $t)
- };
- ($m:ident.values_of($v:expr), $t:ty) => {
- $m.values_of_t::<$t>($v)
- };
-}
-
-/// Deprecated, replaced with [`ArgMatches::values_of_t_or_exit`][crate::ArgMatches::value_of_t_or_exit]
-#[macro_export]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Replaced with `ArgMatches::values_of_t_or_exit`"
- )
-)]
-#[doc(hidden)]
-macro_rules! values_t_or_exit {
- ($m:ident, $v:expr, $t:ty) => {
- values_t_or_exit!($m.values_of($v), $t)
- };
- ($m:ident.values_of($v:expr), $t:ty) => {
- $m.values_of_t_or_exit::<$t>($v)
- };
-}
-
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `ArgEnum`")
-)]
-#[doc(hidden)]
-#[macro_export]
-macro_rules! _clap_count_exprs {
- () => { 0 };
- ($e:expr) => { 1 };
- ($e:expr, $($es:expr),+) => { 1 + $crate::_clap_count_exprs!($($es),*) };
-}
-
-/// Deprecated, replaced with [`ArgEnum`][crate::ArgEnum]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.0.0", note = "Replaced with `ArgEnum`")
-)]
-#[doc(hidden)]
-#[macro_export]
-macro_rules! arg_enum {
- (@as_item $($i:item)*) => ($($i)*);
- (@impls ( $($tts:tt)* ) -> ($e:ident, $($v:ident),+)) => {
- $crate::arg_enum!(@as_item
- $($tts)*
-
- impl ::std::str::FromStr for $e {
- type Err = String;
-
- fn from_str(s: &str) -> ::std::result::Result<Self,Self::Err> {
- #[allow(deprecated, unused_imports)]
- use ::std::ascii::AsciiExt;
- match s {
- $(stringify!($v) |
- _ if s.eq_ignore_ascii_case(stringify!($v)) => Ok($e::$v)),+,
- _ => Err({
- let v = vec![
- $(stringify!($v),)+
- ];
- format!("valid values: {}",
- v.join(", "))
- }),
- }
- }
- }
- impl ::std::fmt::Display for $e {
- fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- match *self {
- $($e::$v => write!(f, stringify!($v)),)+
- }
- }
- }
- impl $e {
- #[allow(dead_code)]
- pub fn variants() -> [&'static str; $crate::_clap_count_exprs!($(stringify!($v)),+)] {
- [
- $(stringify!($v),)+
- ]
- }
- });
- };
- ($(#[$($m:meta),+])+ pub enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
- $crate::arg_enum!(@impls
- ($(#[$($m),+])+
- pub enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- ($(#[$($m:meta),+])+ pub enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
- $crate::arg_enum!(@impls
- ($(#[$($m),+])+
- pub enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- ($(#[$($m:meta),+])+ enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
- $crate::arg_enum!(@impls
- ($(#[$($m),+])+
- enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- ($(#[$($m:meta),+])+ enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
- $crate::arg_enum!(@impls
- ($(#[$($m),+])+
- enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- (pub enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
- $crate::arg_enum!(@impls
- (pub enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- (pub enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
- $crate::arg_enum!(@impls
- (pub enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- (enum $e:ident { $($v:ident $(=$val:expr)*,)+ } ) => {
- $crate::arg_enum!(@impls
- (enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
- (enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => {
- $crate::arg_enum!(@impls
- (enum $e {
- $($v$(=$val)*),+
- }) -> ($e, $($v),+)
- );
- };
-}
-
-/// Allows you to pull the version from your Cargo.toml at compile time as
-/// `MAJOR.MINOR.PATCH_PKGVERSION_PRE`
-///
-/// # Examples
-///
-/// ```no_run
-/// # #[macro_use]
-/// # extern crate clap;
-/// # use clap::Command;
-/// # fn main() {
-/// let m = Command::new("cmd")
-/// .version(crate_version!())
-/// .get_matches();
-/// # }
-/// ```
-#[cfg(feature = "cargo")]
-#[macro_export]
-macro_rules! crate_version {
- () => {
- env!("CARGO_PKG_VERSION")
- };
-}
-
-/// Allows you to pull the authors for the command from your Cargo.toml at
-/// compile time in the form:
-/// `"author1 lastname <author1@example.com>:author2 lastname <author2@example.com>"`
-///
-/// You can replace the colons with a custom separator by supplying a
-/// replacement string, so, for example,
-/// `crate_authors!(",\n")` would become
-/// `"author1 lastname <author1@example.com>,\nauthor2 lastname <author2@example.com>,\nauthor3 lastname <author3@example.com>"`
-///
-/// # Examples
-///
-/// ```no_run
-/// # #[macro_use]
-/// # extern crate clap;
-/// # use clap::Command;
-/// # fn main() {
-/// let m = Command::new("cmd")
-/// .author(crate_authors!("\n"))
-/// .get_matches();
-/// # }
-/// ```
-#[cfg(feature = "cargo")]
-#[macro_export]
-macro_rules! crate_authors {
- ($sep:expr) => {{
- static CACHED: clap::once_cell::sync::Lazy<String> =
- clap::once_cell::sync::Lazy::new(|| env!("CARGO_PKG_AUTHORS").replace(':', $sep));
-
- let s: &'static str = &*CACHED;
- s
- }};
- () => {
- env!("CARGO_PKG_AUTHORS")
- };
-}
-
-/// Allows you to pull the description from your Cargo.toml at compile time.
-///
-/// # Examples
-///
-/// ```no_run
-/// # #[macro_use]
-/// # extern crate clap;
-/// # use clap::Command;
-/// # fn main() {
-/// let m = Command::new("cmd")
-/// .about(crate_description!())
-/// .get_matches();
-/// # }
-/// ```
-#[cfg(feature = "cargo")]
-#[macro_export]
-macro_rules! crate_description {
- () => {
- env!("CARGO_PKG_DESCRIPTION")
- };
-}
-
-/// Allows you to pull the name from your Cargo.toml at compile time.
-///
-/// # Examples
-///
-/// ```no_run
-/// # #[macro_use]
-/// # extern crate clap;
-/// # use clap::Command;
-/// # fn main() {
-/// let m = Command::new(crate_name!())
-/// .get_matches();
-/// # }
-/// ```
-#[cfg(feature = "cargo")]
-#[macro_export]
-macro_rules! crate_name {
- () => {
- env!("CARGO_PKG_NAME")
- };
-}
-
-/// Allows you to build the `Command` instance from your Cargo.toml at compile time.
-///
-/// **NOTE:** Changing the values in your `Cargo.toml` does not trigger a re-build automatically,
-/// and therefore won't change the generated output until you recompile.
-///
-/// In some cases you can "trick" the compiler into triggering a rebuild when your
-/// `Cargo.toml` is changed by including this in your `src/main.rs` file
-/// `include_str!("../Cargo.toml");`
-///
-/// # Examples
-///
-/// ```no_run
-/// # #[macro_use]
-/// # extern crate clap;
-/// # fn main() {
-/// let m = command!().get_matches();
-/// # }
-/// ```
-#[cfg(feature = "cargo")]
-#[macro_export]
-macro_rules! command {
- () => {{
- $crate::command!($crate::crate_name!())
- }};
- ($name:expr) => {{
- let mut cmd = $crate::Command::new($name).version($crate::crate_version!());
-
- let author = $crate::crate_authors!();
- if !author.is_empty() {
- cmd = cmd.author(author)
- }
-
- let about = $crate::crate_description!();
- if !about.is_empty() {
- cmd = cmd.about(about)
- }
-
- cmd
- }};
-}
-
-/// Requires `cargo` feature flag to be enabled.
-#[cfg(not(feature = "cargo"))]
-#[macro_export]
-macro_rules! command {
- () => {{
- compile_error!("`cargo` feature flag is required");
- }};
- ($name:expr) => {{
- compile_error!("`cargo` feature flag is required");
- }};
-}
-
-/// Deprecated, replaced with [`clap::command!`][crate::command]
-#[cfg(feature = "cargo")]
-#[cfg_attr(
- feature = "deprecated",
- deprecated(since = "3.1.0", note = "Replaced with `clap::command!")
-)]
-#[macro_export]
-macro_rules! app_from_crate {
- () => {{
- let mut cmd = $crate::Command::new($crate::crate_name!()).version($crate::crate_version!());
-
- let author = $crate::crate_authors!(", ");
- if !author.is_empty() {
- cmd = cmd.author(author)
- }
-
- let about = $crate::crate_description!();
- if !about.is_empty() {
- cmd = cmd.about(about)
- }
-
- cmd
- }};
- ($sep:expr) => {{
- let mut cmd = $crate::Command::new($crate::crate_name!()).version($crate::crate_version!());
-
- let author = $crate::crate_authors!($sep);
- if !author.is_empty() {
- cmd = cmd.author(author)
- }
-
- let about = $crate::crate_description!();
- if !about.is_empty() {
- cmd = cmd.about(about)
- }
-
- cmd
- }};
-}
-
-#[doc(hidden)]
-#[macro_export]
-macro_rules! arg_impl {
- ( @string $val:ident ) => {
- stringify!($val)
- };
- ( @string $val:literal ) => {{
- let ident_or_string_literal: &str = $val;
- ident_or_string_literal
- }};
- ( @string $val:tt ) => {
- ::std::compile_error!("Only identifiers or string literals supported");
- };
- ( @string ) => {
- None
- };
-
- ( @char $val:ident ) => {{
- let ident_or_char_literal = stringify!($val);
- debug_assert_eq!(
- ident_or_char_literal.len(),
- 1,
- "Single-letter identifier expected, got {}",
- ident_or_char_literal
- );
- ident_or_char_literal.chars().next().unwrap()
- }};
- ( @char $val:literal ) => {{
- let ident_or_char_literal: char = $val;
- ident_or_char_literal
- }};
- ( @char ) => {{
- None
- }};
-
- (
- @arg
- ($arg:expr)
- --$long:ident
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
- }
-
- let mut arg = $arg;
- let long = $crate::arg_impl! { @string $long };
- if arg.get_id().is_empty() {
- arg = arg.id(long);
- }
- arg.long(long)
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- --$long:literal
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
- }
-
- let mut arg = $arg;
- let long = $crate::arg_impl! { @string $long };
- if arg.get_id().is_empty() {
- arg = arg.id(long);
- }
- arg.long(long)
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- -$short:ident
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- debug_assert_eq!($arg.get_long(), None, "Short flags should precede long flags");
- debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
- }
-
- $arg.short($crate::arg_impl! { @char $short })
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- -$short:literal
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- debug_assert_eq!($arg.get_long(), None, "Short flags should precede long flags");
- debug_assert_eq!($arg.get_value_names(), None, "Flags should precede values");
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Flags should precede `...`");
- }
-
- $arg.short($crate::arg_impl! { @char $short })
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- <$value_name:ident>
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
- }
- debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
-
- let mut arg = $arg;
-
- arg = arg.required(true);
- arg = arg.takes_value(true);
-
- let value_name = $crate::arg_impl! { @string $value_name };
- if arg.get_id().is_empty() {
- arg = arg.id(value_name);
- }
- arg.value_name(value_name)
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- <$value_name:literal>
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
- }
- debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
-
- let mut arg = $arg;
-
- arg = arg.required(true);
- arg = arg.takes_value(true);
-
- let value_name = $crate::arg_impl! { @string $value_name };
- if arg.get_id().is_empty() {
- arg = arg.id(value_name);
- }
- arg.value_name(value_name)
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- [$value_name:ident]
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
- }
- debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
-
- let mut arg = $arg;
-
- if arg.get_long().is_none() && arg.get_short().is_none() {
- arg = arg.required(false);
- } else {
- arg = arg.min_values(0).max_values(1);
- }
- arg = arg.takes_value(true);
-
- let value_name = $crate::arg_impl! { @string $value_name };
- if arg.get_id().is_empty() {
- arg = arg.id(value_name);
- }
- arg.value_name(value_name)
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- [$value_name:literal]
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({
- #[allow(deprecated)]
- {
- debug_assert!(!$arg.is_multiple_occurrences_set(), "Values should precede `...`");
- }
- debug_assert_eq!($arg.get_value_names(), None, "Multiple values not yet supported");
-
- let mut arg = $arg;
-
- if arg.get_long().is_none() && arg.get_short().is_none() {
- arg = arg.required(false);
- } else {
- arg = arg.min_values(0).max_values(1);
- }
- arg = arg.takes_value(true);
-
- let value_name = $crate::arg_impl! { @string $value_name };
- if arg.get_id().is_empty() {
- arg = arg.id(value_name);
- }
- arg.value_name(value_name)
- })
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- ...
- $($tail:tt)*
- ) => {
- $crate::arg_impl! {
- @arg
- ({#[allow(deprecated)]{
- $arg.multiple_occurrences(true)
- }})
- $($tail)*
- }
- };
- (
- @arg
- ($arg:expr)
- $help:literal
- ) => {
- $arg.help($help)
- };
- (
- @arg
- ($arg:expr)
- ) => {
- $arg
- };
-}
-
-/// Create an [`Arg`] from a usage string.
-///
-/// Allows creation of basic settings for the [`Arg`].
-///
-/// **NOTE**: Not all settings may be set using the usage string method. Some properties are
-/// only available via the builder pattern.
-///
-/// # Syntax
-///
-/// Usage strings typically following the form:
-///
-/// ```notrust
-/// [explicit name] [short] [long] [value names] [...] [help string]
-/// ```
-///
-/// ### Explicit Name
-///
-/// The name may be either a bare-word or a string, followed by a `:`, like `name:` or
-/// `"name":`.
-///
-/// *Note:* This is an optional field, if it's omitted the argument will use one of the additional
-/// fields as the name using the following priority order:
-///
-/// 1. Explicit Name
-/// 2. Long
-/// 3. Value Name
-///
-/// See [`Arg::name`][crate::Arg::name].
-///
-/// ### Short
-///
-/// A short flag is a `-` followed by either a bare-character or quoted character, like `-f` or
-/// `-'f'`.
-///
-/// See [`Arg::short`][crate::Arg::short].
-///
-/// ### Long
-///
-/// A long flag is a `--` followed by either a bare-word or a string, like `--foo` or
-/// `--"foo"`.
-///
-/// See [`Arg::long`][crate::Arg::long].
-///
-/// ### Values (Value Notation)
-///
-/// This is set by placing bare-word between:
-/// - `[]` like `[FOO]`
-/// - Positional argument: optional
-/// - Named argument: optional value
-/// - `<>` like `<FOO>`: required
-///
-/// See [`Arg::value_name`][crate::Arg::value_name].
-///
-/// ### `...`
-///
-/// `...` (three consecutive dots/periods) specifies that this argument may occur multiple
-/// times (not to be confused with multiple values per occurrence).
-///
-/// See [`Arg::multiple_occurrences`][crate::Arg::multiple_occurrences].
-///
-/// ### Help String
-///
-/// The help string is denoted between a pair of double quotes `""` and may contain any
-/// characters.
-///
-/// # Examples
-///
-/// ```rust
-/// # use clap::{Command, Arg, arg};
-/// Command::new("prog")
-/// .args(&[
-/// arg!(--config <FILE> "a required file for the configuration and no short"),
-/// arg!(-d --debug ... "turns on debugging information and allows multiples"),
-/// arg!([input] "an optional input file to use")
-/// ])
-/// # ;
-/// ```
-/// [`Arg`]: ./struct.Arg.html
-#[macro_export]
-macro_rules! arg {
- ( $name:ident: $($tail:tt)+ ) => {
- $crate::arg_impl! {
- @arg ($crate::Arg::new($crate::arg_impl! { @string $name })) $($tail)+
- }
- };
- ( $($tail:tt)+ ) => {{
- let arg = $crate::arg_impl! {
- @arg ($crate::Arg::default()) $($tail)+
- };
- debug_assert!(!arg.get_id().is_empty(), "Without a value or long flag, the `name:` prefix is required");
- arg
- }};
-}
-
-/// Deprecated, replaced with [`clap::Parser`][crate::Parser] and [`clap::arg!`][crate::arg] (Issue clap-rs/clap#2835)
-#[cfg_attr(
- feature = "deprecated",
- deprecated(
- since = "3.0.0",
- note = "Replaced with `clap::Parser` for a declarative API (Issue clap-rs/clap#2835)"
- )
-)]
-#[doc(hidden)]
-#[macro_export]
-macro_rules! clap_app {
- (@app ($builder:expr)) => { $builder };
- (@app ($builder:expr) (@arg ($name:expr): $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($builder.arg(
- $crate::clap_app!{ @arg ($crate::Arg::new($name)) (-) $($tail)* }))
- $($tt)*
- }
- };
- (@app ($builder:expr) (@arg $name:ident: $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($builder.arg(
- $crate::clap_app!{ @arg ($crate::Arg::new(stringify!($name))) (-) $($tail)* }))
- $($tt)*
- }
- };
- (@app ($builder:expr) (@setting $setting:ident) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($builder.setting($crate::AppSettings::$setting))
- $($tt)*
- }
- };
-// Treat the application builder as an argument to set its attributes
- (@app ($builder:expr) (@attributes $($attr:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app ($crate::clap_app!{ @arg ($builder) $($attr)* }) $($tt)* }
- };
- (@app ($builder:expr) (@group $name:ident => $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($crate::clap_app!{ @group ($builder, $crate::ArgGroup::new(stringify!($name))) $($tail)* })
- $($tt)*
- }
- };
- (@app ($builder:expr) (@group $name:ident !$ident:ident => $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($crate::clap_app!{ @group ($builder, $crate::ArgGroup::new(stringify!($name)).$ident(false)) $($tail)* })
- $($tt)*
- }
- };
- (@app ($builder:expr) (@group $name:ident +$ident:ident => $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($crate::clap_app!{ @group ($builder, $crate::ArgGroup::new(stringify!($name)).$ident(true)) $($tail)* })
- $($tt)*
- }
- };
-// Handle subcommand creation
- (@app ($builder:expr) (@subcommand $name:ident => $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @app
- ($builder.subcommand(
- $crate::clap_app!{ @app ($crate::Command::new(stringify!($name))) $($tail)* }
- ))
- $($tt)*
- }
- };
-// Yaml like function calls - used for setting various meta directly against the app
- (@app ($builder:expr) ($ident:ident: $($v:expr),*) $($tt:tt)*) => {
-// $crate::clap_app!{ @app ($builder.$ident($($v),*)) $($tt)* }
- $crate::clap_app!{ @app
- ($builder.$ident($($v),*))
- $($tt)*
- }
- };
-
-// Add members to group and continue argument handling with the parent builder
- (@group ($builder:expr, $group:expr)) => { $builder.group($group) };
- // Treat the group builder as an argument to set its attributes
- (@group ($builder:expr, $group:expr) (@attributes $($attr:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @group ($builder, $crate::clap_app!{ @arg ($group) (-) $($attr)* }) $($tt)* }
- };
- (@group ($builder:expr, $group:expr) (@arg $name:ident: $($tail:tt)*) $($tt:tt)*) => {
- $crate::clap_app!{ @group
- ($crate::clap_app!{ @app ($builder) (@arg $name: $($tail)*) },
- $group.arg(stringify!($name)))
- $($tt)*
- }
- };
-
-// No more tokens to munch
- (@arg ($arg:expr) $modes:tt) => { $arg };
-// Shorthand tokens influenced by the usage_string
- (@arg ($arg:expr) $modes:tt --($long:expr) $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.long($long)) $modes $($tail)* }
- };
- (@arg ($arg:expr) $modes:tt --$long:ident $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.long(stringify!($long))) $modes $($tail)* }
- };
- (@arg ($arg:expr) $modes:tt -$short:ident $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.short(stringify!($short).chars().next().unwrap())) $modes $($tail)* }
- };
- (@arg ($arg:expr) (-) <$var:ident> $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value +required $($tail)* }
- };
- (@arg ($arg:expr) (+) <$var:ident> $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) $($tail)* }
- };
- (@arg ($arg:expr) (-) [$var:ident] $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value $($tail)* }
- };
- (@arg ($arg:expr) (+) [$var:ident] $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) $($tail)* }
- };
- (@arg ($arg:expr) $modes:tt ... $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg) $modes +multiple +takes_value $($tail)* }
- };
-// Shorthand magic
- (@arg ($arg:expr) $modes:tt #{$n:expr, $m:expr} $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg) $modes min_values($n) max_values($m) $($tail)* }
- };
- (@arg ($arg:expr) $modes:tt * $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg) $modes +required $($tail)* }
- };
-// !foo -> .foo(false)
- (@arg ($arg:expr) $modes:tt !$ident:ident $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.$ident(false)) $modes $($tail)* }
- };
-// +foo -> .foo(true)
- (@arg ($arg:expr) $modes:tt +$ident:ident $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.$ident(true)) $modes $($tail)* }
- };
-// Validator
- (@arg ($arg:expr) $modes:tt {$fn_:expr} $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.validator($fn_)) $modes $($tail)* }
- };
- (@as_expr $expr:expr) => { $expr };
-// Help
- (@arg ($arg:expr) $modes:tt $desc:tt) => { $arg.help($crate::clap_app!{ @as_expr $desc }) };
-// Handle functions that need to be called multiple times for each argument
- (@arg ($arg:expr) $modes:tt $ident:ident[$($target:ident)*] $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg $( .$ident(stringify!($target)) )*) $modes $($tail)* }
- };
-// Inherit builder's functions, e.g. `index(2)`, `requires_if("val", "arg")`
- (@arg ($arg:expr) $modes:tt $ident:ident($($expr:expr),*) $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.$ident($($expr),*)) $modes $($tail)* }
- };
-// Inherit builder's functions with trailing comma, e.g. `index(2,)`, `requires_if("val", "arg",)`
- (@arg ($arg:expr) $modes:tt $ident:ident($($expr:expr,)*) $($tail:tt)*) => {
- $crate::clap_app!{ @arg ($arg.$ident($($expr),*)) $modes $($tail)* }
- };
-
-// Build a subcommand outside of an app.
- (@subcommand $name:ident => $($tail:tt)*) => {
- $crate::clap_app!{ @app ($crate::Command::new(stringify!($name))) $($tail)* }
- };
-// Start the magic
- (($name:expr) => $($tail:tt)*) => {{
- $crate::clap_app!{ @app ($crate::Command::new($name)) $($tail)*}
- }};
-
- ($name:ident => $($tail:tt)*) => {{
- $crate::clap_app!{ @app ($crate::Command::new(stringify!($name))) $($tail)*}
- }};
-}
-
-macro_rules! impl_settings {
- ($settings:ident, $flags:ident,
- $(
- $(#[$inner:ident $($args:tt)*])*
- $setting:ident => $flag:path
- ),+
- ) => {
- impl $flags {
- #[allow(dead_code)]
- pub(crate) fn empty() -> Self {
- $flags(Flags::empty())
- }
-
- #[allow(dead_code)]
- pub(crate) fn insert(&mut self, rhs: Self) {
- self.0.insert(rhs.0);
- }
-
- #[allow(dead_code)]
- pub(crate) fn remove(&mut self, rhs: Self) {
- self.0.remove(rhs.0);
- }
-
- #[allow(dead_code)]
- pub(crate) fn set(&mut self, s: $settings) {
- #[allow(deprecated)] // some Settings might be deprecated
- match s {
- $(
- $(#[$inner $($args)*])*
- $settings::$setting => self.0.insert($flag),
- )*
- }
- }
-
- #[allow(dead_code)]
- pub(crate) fn unset(&mut self, s: $settings) {
- #[allow(deprecated)] // some Settings might be deprecated
- match s {
- $(
- $(#[$inner $($args)*])*
- $settings::$setting => self.0.remove($flag),
- )*
- }
- }
-
- #[allow(dead_code)]
- pub(crate) fn is_set(&self, s: $settings) -> bool {
- #[allow(deprecated)] // some Settings might be deprecated
- match s {
- $(
- $(#[$inner $($args)*])*
- $settings::$setting => self.0.contains($flag),
- )*
- }
- }
- }
-
- impl BitOr for $flags {
- type Output = Self;
-
- fn bitor(mut self, rhs: Self) -> Self::Output {
- self.0.insert(rhs.0);
- self
- }
- }
-
- impl From<$settings> for $flags {
- fn from(setting: $settings) -> Self {
- let mut flags = $flags::empty();
- flags.set(setting);
- flags
- }
- }
-
- impl BitOr<$settings> for $flags {
- type Output = Self;
-
- fn bitor(mut self, rhs: $settings) -> Self::Output {
- self.set(rhs);
- self
- }
- }
-
- impl BitOr for $settings {
- type Output = $flags;
-
- fn bitor(self, rhs: Self) -> Self::Output {
- let mut flags = $flags::empty();
- flags.set(self);
- flags.set(rhs);
- flags
- }
- }
- }
-}
-
-// Convenience for writing to stderr thanks to https://github.com/BurntSushi
-macro_rules! wlnerr {
- ($($arg:tt)*) => ({
- use std::io::{Write, stderr};
- writeln!(&mut stderr(), $($arg)*).ok();
- })
-}
-
-#[cfg(feature = "debug")]
-macro_rules! debug {
- ($($arg:tt)*) => ({
- let prefix = format!("[{:>w$}] \t", module_path!(), w = 28);
- let body = format!($($arg)*);
- let mut color = $crate::output::fmt::Colorizer::new($crate::output::fmt::Stream::Stderr, $crate::ColorChoice::Auto);
- color.hint(prefix);
- color.hint(body);
- color.none("\n");
- let _ = color.print();
- })
-}
-
-#[cfg(not(feature = "debug"))]
-macro_rules! debug {
- ($($arg:tt)*) => {};
-}
diff --git a/vendor/clap/src/parser/error.rs b/vendor/clap/src/parser/error.rs
deleted file mode 100644
index bdafa9ae5..000000000
--- a/vendor/clap/src/parser/error.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-use crate::util::Id;
-
-/// Violation of [`ArgMatches`][crate::ArgMatches] assumptions
-#[derive(Clone, Debug)]
-#[allow(missing_copy_implementations)] // We might add non-Copy types in the future
-#[non_exhaustive]
-pub enum MatchesError {
- /// Failed to downcast `AnyValue` to the specified type
- #[non_exhaustive]
- Downcast {
- /// Type for value stored in [`ArgMatches`][crate::ArgMatches]
- actual: super::AnyValueId,
- /// The target type to downcast to
- expected: super::AnyValueId,
- },
- /// Argument not defined in [`Command`][crate::Command]
- #[non_exhaustive]
- UnknownArgument {
- // Missing `id` but blocked on a public id type which will hopefully come with `unstable-v4`
- },
-}
-
-impl MatchesError {
- #[track_caller]
- pub(crate) fn unwrap<T>(id: &Id, r: Result<T, MatchesError>) -> T {
- let err = match r {
- Ok(t) => {
- return t;
- }
- Err(err) => err,
- };
- panic!(
- "Mismatch between definition and access of `{:?}`. {}",
- id, err
- )
- }
-}
-
-impl std::error::Error for MatchesError {}
-
-impl std::fmt::Display for MatchesError {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
- match self {
- Self::Downcast { actual, expected } => {
- writeln!(
- f,
- "Could not downcast to {:?}, need to downcast to {:?}",
- expected, actual
- )
- }
- Self::UnknownArgument {} => {
- writeln!(f, "Unknown argument or group id. Make sure you are using the argument id and not the short or long flags")
- }
- }
- }
-}
diff --git a/vendor/clap_derive/.cargo-checksum.json b/vendor/clap_derive/.cargo-checksum.json
index 8d3303f99..1dfa35a62 100644
--- a/vendor/clap_derive/.cargo-checksum.json
+++ b/vendor/clap_derive/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"29d214d0c807739f6d147a1a472dfab5d929b4dd31623f670df28a713be107e8","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5","README.md":"d99fca4ba5976a41b150cd7f5c17100e0d275b9bf48b51a0d964115dc81e20b9","src/attrs.rs":"dd4288ac38aeb184bbffade71af48706034f10d311068af2917c0f96d813698a","src/derives/args.rs":"27a13d33f24f7f7668c82fa653978e909514bd39e808c7996fddb0d3a3c0e570","src/derives/into_app.rs":"02c36d403ad35e3d49de6042cacecf2a724561b5e3948b5aec4b45646e031877","src/derives/mod.rs":"ff7947fddee4b3d8365e29459a02458382e13df022aee822e09bce1ac255d3bb","src/derives/parser.rs":"9ca609e6e5bfb303e22b4ecb8aca9035571179920b0df91031e9f987559252e0","src/derives/subcommand.rs":"0513c48013c2bd9f450ffc7bfcbf84b3a3290e37ff571dd070798356c2b291ac","src/derives/value_enum.rs":"27b87ccb6829925f6ffa631109217bffd81b74f61519841678bd6d8c5cfcbe40","src/dummies.rs":"02f111bbd84b8f0525faeb9189c59cb2fd2df05ae6c7b014735c82feac5ff23f","src/lib.rs":"e4be47e8db06a6555a2a4cd1802d17c16a3b51ae0ec291b3ec75ef2b6517eb0e","src/parse.rs":"f0d720da5477755bdce02fcd248a57efe74b2fbbc5e07c5dc17d9bf78b017958","src/utils/doc_comments.rs":"386859b274fd1e298aeaeafd2b20764db0957cbb4e6c9e8bab52a506a0b8ecda","src/utils/mod.rs":"ee28526587d2d80d5dba162f28191f44f6a0c296d0e52225eb74b90534d49b25","src/utils/spanned.rs":"e93600124c54985533f74fe23f096f4ada94b310eff97a16f0ce40fb0f690a3b","src/utils/ty.rs":"0a9b8c5dabfa28388b60423f4b6075a275b347258ac35301997cb0d7f763607f"},"package":"c11d40217d16aee8508cc8e5fde8b4ff24639758608e5374e731b53f85749fb9"} \ No newline at end of file
+{"files":{"Cargo.toml":"eaf10a4c685b527f604ea9f84fbe7095e15fe4424225c57481d0555a89dfb054","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-MIT":"0d687e1f07b58fe68bda74668ff6326125e5e5efa184cce755cd84ac535b7058","README.md":"4ec07b9c59a2ddcedcdc9d21d51c147b18157794b03ff2ea5ae57f2b5236943d","src/attrs.rs":"1c95a75fd377d19587f429d3f51544ac0ca96f868cce4ffe12d1163f7465fa73","src/derives/args.rs":"27a13d33f24f7f7668c82fa653978e909514bd39e808c7996fddb0d3a3c0e570","src/derives/into_app.rs":"02c36d403ad35e3d49de6042cacecf2a724561b5e3948b5aec4b45646e031877","src/derives/mod.rs":"ff7947fddee4b3d8365e29459a02458382e13df022aee822e09bce1ac255d3bb","src/derives/parser.rs":"9ca609e6e5bfb303e22b4ecb8aca9035571179920b0df91031e9f987559252e0","src/derives/subcommand.rs":"0513c48013c2bd9f450ffc7bfcbf84b3a3290e37ff571dd070798356c2b291ac","src/derives/value_enum.rs":"4d0958d3a767c82f2366d8fda20367c5aa033af616d09ef581e8abdb2e029a70","src/dummies.rs":"02f111bbd84b8f0525faeb9189c59cb2fd2df05ae6c7b014735c82feac5ff23f","src/lib.rs":"e4be47e8db06a6555a2a4cd1802d17c16a3b51ae0ec291b3ec75ef2b6517eb0e","src/parse.rs":"ceaac282cabccfac5bcf56ce02095c9acbf00dbfdd3c3009fa58e87bdde46218","src/utils/doc_comments.rs":"386859b274fd1e298aeaeafd2b20764db0957cbb4e6c9e8bab52a506a0b8ecda","src/utils/mod.rs":"ee28526587d2d80d5dba162f28191f44f6a0c296d0e52225eb74b90534d49b25","src/utils/spanned.rs":"e93600124c54985533f74fe23f096f4ada94b310eff97a16f0ce40fb0f690a3b","src/utils/ty.rs":"0a9b8c5dabfa28388b60423f4b6075a275b347258ac35301997cb0d7f763607f"},"package":"ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"} \ No newline at end of file
diff --git a/vendor/clap_derive/Cargo.toml b/vendor/clap_derive/Cargo.toml
index 49e3fd963..f74476e68 100644
--- a/vendor/clap_derive/Cargo.toml
+++ b/vendor/clap_derive/Cargo.toml
@@ -11,9 +11,9 @@
[package]
edition = "2021"
-rust-version = "1.56.0"
+rust-version = "1.56.1"
name = "clap_derive"
-version = "3.2.5"
+version = "3.2.18"
include = [
"build.rs",
"src/**/*",
@@ -24,7 +24,6 @@ include = [
"examples/**/*",
]
description = "Parse command line argument by defining a struct, derive crate."
-documentation = "https://docs.rs/clap_derive"
readme = "README.md"
keywords = [
"clap",
diff --git a/vendor/clap_derive/LICENSE-MIT b/vendor/clap_derive/LICENSE-MIT
index 5acedf041..7b05b8453 100644
--- a/vendor/clap_derive/LICENSE-MIT
+++ b/vendor/clap_derive/LICENSE-MIT
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015-2016 Kevin B. Knapp
+Copyright (c) 2015-2022 Kevin B. Knapp and Clap Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/clap_derive/README.md b/vendor/clap_derive/README.md
index 1acadb355..17f649eda 100644
--- a/vendor/clap_derive/README.md
+++ b/vendor/clap_derive/README.md
@@ -3,8 +3,8 @@
Macro implementation for clap's derives.
[docs.rs](https://docs.rs/clap)
-- [Derive Tutorial](https://github.com/clap-rs/clap/blob/v3.2.5/examples/tutorial_derive/README.md)
-- [Derive Reference](https://github.com/clap-rs/clap/blob/v3.2.5/examples/derive_ref/README.md)
+- [Derive Tutorial](https://github.com/clap-rs/clap/blob/v3.2.18/examples/tutorial_derive/README.md)
+- [Derive Reference](https://github.com/clap-rs/clap/blob/v3.2.18/examples/derive_ref/README.md)
## License
diff --git a/vendor/clap_derive/src/attrs.rs b/vendor/clap_derive/src/attrs.rs
index 3c685fbe8..2c5b47d95 100644
--- a/vendor/clap_derive/src/attrs.rs
+++ b/vendor/clap_derive/src/attrs.rs
@@ -450,7 +450,7 @@ impl Attrs {
}
fn push_method(&mut self, name: Ident, arg: impl ToTokens) {
- if name == "name" {
+ if name == "name" || name == "id" {
self.name = Name::Assigned(quote!(#arg));
} else if name == "value_parser" {
self.value_parser = Some(ValueParser::Explicit(Method::new(name, quote!(#arg))));
@@ -552,7 +552,7 @@ impl Attrs {
})
} else {
quote_spanned!(ident.span()=> {
- static DEFAULT_VALUE: clap::once_cell::sync::Lazy<String> = clap::once_cell::sync::Lazy::new(|| {
+ static DEFAULT_VALUE: clap::__macro_refs::once_cell::sync::Lazy<String> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
let val: #ty = #val;
::std::string::ToString::to_string(&val)
});
@@ -564,6 +564,81 @@ impl Attrs {
self.methods.push(Method::new(raw_ident, val));
}
+ DefaultValuesT(ident, expr) => {
+ let ty = if let Some(ty) = self.ty.as_ref() {
+ ty
+ } else {
+ abort!(
+ ident,
+ "#[clap(default_values_t)] (without an argument) can be used \
+ only on field level";
+
+ note = "see \
+ https://github.com/clap-rs/clap/blob/master/examples/derive_ref/README.md#magic-attributes")
+ };
+
+ let container_type = Ty::from_syn_ty(ty);
+ if *container_type != Ty::Vec {
+ abort!(
+ ident,
+ "#[clap(default_values_t)] can be used only on Vec types";
+
+ note = "see \
+ https://github.com/clap-rs/clap/blob/master/examples/derive_ref/README.md#magic-attributes")
+ }
+ let inner_type = inner_type(ty);
+
+ // Use `Borrow<#inner_type>` so we accept `&Vec<#inner_type>` and
+ // `Vec<#inner_type>`.
+ let val = if parsed.iter().any(|a| matches!(a, ValueEnum(_))) {
+ quote_spanned!(ident.span()=> {
+ {
+ fn iter_to_vals<T>(iterable: impl IntoIterator<Item = T>) -> Vec<&'static str>
+ where
+ T: ::std::borrow::Borrow<#inner_type>
+ {
+ iterable
+ .into_iter()
+ .map(|val| {
+ clap::ValueEnum::to_possible_value(val.borrow()).unwrap().get_name()
+ })
+ .collect()
+
+ }
+
+ static DEFAULT_VALUES: clap::__macro_refs::once_cell::sync::Lazy<Vec<&str>> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ iter_to_vals(#expr)
+ });
+ &*DEFAULT_VALUES.as_slice()
+ }
+ })
+ } else {
+ quote_spanned!(ident.span()=> {
+ {
+ fn iter_to_vals<T>(iterable: impl IntoIterator<Item = T>) -> Vec<String>
+ where
+ T: ::std::borrow::Borrow<#inner_type>
+ {
+ iterable.into_iter().map(|val| val.borrow().to_string()).collect()
+
+ }
+
+ static DEFAULT_STRINGS: clap::__macro_refs::once_cell::sync::Lazy<Vec<::std::string::String>> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ iter_to_vals(#expr)
+ });
+
+ static DEFAULT_VALUES: clap::__macro_refs::once_cell::sync::Lazy<Vec<&str>> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ DEFAULT_STRINGS.iter().map(::std::string::String::as_str).collect()
+ });
+ &*DEFAULT_VALUES.as_slice()
+ }
+ })
+ };
+
+ self.methods
+ .push(Method::new(Ident::new("default_values", ident.span()), val));
+ }
+
DefaultValueOsT(ident, expr) => {
let ty = if let Some(ty) = self.ty.as_ref() {
ty
@@ -592,7 +667,7 @@ impl Attrs {
})
} else {
quote_spanned!(ident.span()=> {
- static DEFAULT_VALUE: clap::once_cell::sync::Lazy<::std::ffi::OsString> = clap::once_cell::sync::Lazy::new(|| {
+ static DEFAULT_VALUE: clap::__macro_refs::once_cell::sync::Lazy<::std::ffi::OsString> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
let val: #ty = #val;
::std::ffi::OsString::from(val)
});
@@ -604,6 +679,84 @@ impl Attrs {
self.methods.push(Method::new(raw_ident, val));
}
+ DefaultValuesOsT(ident, expr) => {
+ let ty = if let Some(ty) = self.ty.as_ref() {
+ ty
+ } else {
+ abort!(
+ ident,
+ "#[clap(default_values_os_t)] (without an argument) can be used \
+ only on field level";
+
+ note = "see \
+ https://github.com/clap-rs/clap/blob/master/examples/derive_ref/README.md#magic-attributes")
+ };
+
+ let container_type = Ty::from_syn_ty(ty);
+ if *container_type != Ty::Vec {
+ abort!(
+ ident,
+ "#[clap(default_values_os_t)] can be used only on Vec types";
+
+ note = "see \
+ https://github.com/clap-rs/clap/blob/master/examples/derive_ref/README.md#magic-attributes")
+ }
+ let inner_type = inner_type(ty);
+
+ // Use `Borrow<#inner_type>` so we accept `&Vec<#inner_type>` and
+ // `Vec<#inner_type>`.
+ let val = if parsed.iter().any(|a| matches!(a, ValueEnum(_))) {
+ quote_spanned!(ident.span()=> {
+ {
+ fn iter_to_vals<T>(iterable: impl IntoIterator<Item = T>) -> Vec<&'static ::std::ffi::OsStr>
+ where
+ T: ::std::borrow::Borrow<#inner_type>
+ {
+ iterable
+ .into_iter()
+ .map(|val| {
+ clap::ValueEnum::to_possible_value(val.borrow()).unwrap().get_name()
+ })
+ .map(::std::ffi::OsStr::new)
+ .collect()
+
+ }
+
+ static DEFAULT_VALUES: clap::__macro_refs::once_cell::sync::Lazy<Vec<&::std::ffi::OsStr>> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ iter_to_vals(#expr)
+ });
+ &*DEFAULT_VALUES.as_slice()
+ }
+ })
+ } else {
+ quote_spanned!(ident.span()=> {
+ {
+ fn iter_to_vals<T>(iterable: impl IntoIterator<Item = T>) -> Vec<::std::ffi::OsString>
+ where
+ T: ::std::borrow::Borrow<#inner_type>
+ {
+ iterable.into_iter().map(|val| val.borrow().into()).collect()
+
+ }
+
+ static DEFAULT_OS_STRINGS: clap::__macro_refs::once_cell::sync::Lazy<Vec<::std::ffi::OsString>> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ iter_to_vals(#expr)
+ });
+
+ static DEFAULT_VALUES: clap::__macro_refs::once_cell::sync::Lazy<Vec<&::std::ffi::OsStr>> = clap::__macro_refs::once_cell::sync::Lazy::new(|| {
+ DEFAULT_OS_STRINGS.iter().map(::std::ffi::OsString::as_os_str).collect()
+ });
+ &*DEFAULT_VALUES.as_slice()
+ }
+ })
+ };
+
+ self.methods.push(Method::new(
+ Ident::new("default_values_os", ident.span()),
+ val,
+ ));
+ }
+
NextDisplayOrder(ident, expr) => {
self.next_display_order = Some(Method::new(ident, quote!(#expr)));
}
diff --git a/vendor/clap_derive/src/derives/value_enum.rs b/vendor/clap_derive/src/derives/value_enum.rs
index b18b665c4..06d514f0e 100644
--- a/vendor/clap_derive/src/derives/value_enum.rs
+++ b/vendor/clap_derive/src/derives/value_enum.rs
@@ -84,7 +84,7 @@ fn lits(
None
} else {
if !matches!(variant.fields, Fields::Unit) {
- abort!(variant.span(), "`#[derive(ValueEnum)]` only supports non-unit variants, unless they are skipped");
+ abort!(variant.span(), "`#[derive(ValueEnum)]` only supports unit variants. Non-unit variants must be skipped");
}
let fields = attrs.field_methods(false);
let name = attrs.cased_name();
diff --git a/vendor/clap_derive/src/parse.rs b/vendor/clap_derive/src/parse.rs
index 253736cfd..7d7e19cdc 100644
--- a/vendor/clap_derive/src/parse.rs
+++ b/vendor/clap_derive/src/parse.rs
@@ -53,7 +53,9 @@ pub enum ClapAttr {
// ident = arbitrary_expr
NameExpr(Ident, Expr),
DefaultValueT(Ident, Option<Expr>),
+ DefaultValuesT(Ident, Expr),
DefaultValueOsT(Ident, Option<Expr>),
+ DefaultValuesOsT(Ident, Expr),
NextDisplayOrder(Ident, Expr),
NextHelpHeading(Ident, Expr),
HelpHeading(Ident, Expr),
@@ -122,7 +124,9 @@ impl Parse for ClapAttr {
Ok(expr) => match &*name_str {
"skip" => Ok(Skip(name, Some(expr))),
"default_value_t" => Ok(DefaultValueT(name, Some(expr))),
+ "default_values_t" => Ok(DefaultValuesT(name, expr)),
"default_value_os_t" => Ok(DefaultValueOsT(name, Some(expr))),
+ "default_values_os_t" => Ok(DefaultValuesOsT(name, expr)),
"next_display_order" => Ok(NextDisplayOrder(name, expr)),
"next_help_heading" => Ok(NextHelpHeading(name, expr)),
"help_heading" => Ok(HelpHeading(name, expr)),
diff --git a/vendor/clap_lex/.cargo-checksum.json b/vendor/clap_lex-0.2.2/.cargo-checksum.json
index d1fc5c2fe..d1fc5c2fe 100644
--- a/vendor/clap_lex/.cargo-checksum.json
+++ b/vendor/clap_lex-0.2.2/.cargo-checksum.json
diff --git a/vendor/clap_lex/Cargo.toml b/vendor/clap_lex-0.2.2/Cargo.toml
index b089dcde8..b089dcde8 100644
--- a/vendor/clap_lex/Cargo.toml
+++ b/vendor/clap_lex-0.2.2/Cargo.toml
diff --git a/vendor/clap/LICENSE-APACHE b/vendor/clap_lex-0.2.2/LICENSE-APACHE
index 261eeb9e9..261eeb9e9 100644
--- a/vendor/clap/LICENSE-APACHE
+++ b/vendor/clap_lex-0.2.2/LICENSE-APACHE
diff --git a/vendor/clap/LICENSE-MIT b/vendor/clap_lex-0.2.2/LICENSE-MIT
index 5acedf041..5acedf041 100644
--- a/vendor/clap/LICENSE-MIT
+++ b/vendor/clap_lex-0.2.2/LICENSE-MIT
diff --git a/vendor/clap_lex/README.md b/vendor/clap_lex-0.2.2/README.md
index 0c21bc819..0c21bc819 100644
--- a/vendor/clap_lex/README.md
+++ b/vendor/clap_lex-0.2.2/README.md
diff --git a/vendor/clap_lex/src/lib.rs b/vendor/clap_lex-0.2.2/src/lib.rs
index f205c3de0..f205c3de0 100644
--- a/vendor/clap_lex/src/lib.rs
+++ b/vendor/clap_lex-0.2.2/src/lib.rs
diff --git a/vendor/clap_lex/LICENSE-APACHE b/vendor/clap_lex/LICENSE-APACHE
deleted file mode 100644
index 261eeb9e9..000000000
--- a/vendor/clap_lex/LICENSE-APACHE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/clap_lex/LICENSE-MIT b/vendor/clap_lex/LICENSE-MIT
deleted file mode 100644
index 5acedf041..000000000
--- a/vendor/clap_lex/LICENSE-MIT
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015-2016 Kevin B. Knapp
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.