Created
August 25, 2017 13:46
-
-
Save snowe2010/71b09a435d24533a69a5337b1a150f91 to your computer and use it in GitHub Desktop.
debug output for clap failing short args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cargo run --features yaml,debug --example test start -- -g -i -s -b (master|✚1…) | |
Compiling clap v2.26.0 (file:///Users/tylerthrailkill/Documents/dev/code/clap-rs) | |
warning: unused macro definition | |
--> src/macros.rs:783:5 | |
| | |
783 | / macro_rules! sdebug { | |
784 | | ($fmt:expr) => (print!($fmt)); | |
785 | | ($fmt:expr, $($arg:tt)*) => (print!($fmt, $($arg)*)); | |
786 | | } | |
| |_____^ | |
| | |
= note: #[warn(unused_macros)] on by default | |
warning: unused variable: `matches` | |
--> examples/test.rs:12:25 | |
| | |
12 | ("subcmd", Some(matches)) => println!("did it"), | |
| ^^^^^^^ | |
| | |
= note: #[warn(unused_variables)] on by default | |
= note: to disable this warning, consider using `_matches` instead | |
Finished dev [unoptimized + debuginfo] target(s) in 20.53 secs | |
Running `target/debug/examples/test start -g -i -s -b` | |
DEBUG:clap:Parser::add_subcommand: term_w=None, name=start | |
DEBUG:clap:Parser::propogate_settings: self=Example showing failure, g_settings=AppFlags( | |
NEEDS_LONG_HELP | NEEDS_LONG_VERSION | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO | |
) | |
DEBUG:clap:Parser::propogate_settings: sc=start, settings=AppFlags( | |
NEEDS_LONG_HELP | NEEDS_LONG_VERSION | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO | |
), g_settings=AppFlags( | |
NEEDS_LONG_HELP | NEEDS_LONG_VERSION | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO | |
) | |
DEBUG:clap:Parser::propogate_settings: self=start, g_settings=AppFlags( | |
NEEDS_LONG_HELP | NEEDS_LONG_VERSION | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO | |
) | |
DEBUG:clap:Parser::get_matches_with; | |
DEBUG:clap:Parser::create_help_and_version; | |
DEBUG:clap:Parser::create_help_and_version: Building --help | |
DEBUG:clap:Parser::create_help_and_version: Building --version | |
DEBUG:clap:Parser::create_help_and_version: Building help | |
DEBUG:clap:Parser::get_matches_with: Begin parsing '"start"' ([115, 116, 97, 114, 116]) | |
DEBUG:clap:Parser::is_new_arg: arg="start", Needs Val of=NotFound | |
DEBUG:clap:Parser::is_new_arg: Arg::allow_leading_hyphen(false) | |
DEBUG:clap:Parser::is_new_arg: probably value | |
DEBUG:clap:Parser::is_new_arg: starts_new_arg=false | |
DEBUG:clap:Parser::possible_subcommand: arg="start" | |
DEBUG:clap:Parser::get_matches_with: possible_sc=true, sc=Some("start") | |
DEBUG:clap:Parser::parse_subcommand; | |
DEBUG:clap:usage::get_required_usage_from: reqs=[], extra=None | |
DEBUG:clap:usage::get_required_usage_from: after init desc_reqs=[] | |
DEBUG:clap:usage::get_required_usage_from: no more children | |
DEBUG:clap:usage::get_required_usage_from: final desc_reqs=[] | |
DEBUG:clap:usage::get_required_usage_from: args_in_groups=[] | |
DEBUG:clap:Parser::parse_subcommand: About to parse sc=start | |
DEBUG:clap:Parser::parse_subcommand: sc settings=AppFlags( | |
NEEDS_LONG_HELP | NEEDS_LONG_VERSION | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO | |
) | |
DEBUG:clap:Parser::get_matches_with; | |
DEBUG:clap:Parser::create_help_and_version; | |
DEBUG:clap:Parser::create_help_and_version: Building --help | |
DEBUG:clap:Parser::create_help_and_version: Building --version | |
DEBUG:clap:Parser::get_matches_with: Begin parsing '"-g"' ([45, 103]) | |
DEBUG:clap:Parser::is_new_arg: arg="-g", Needs Val of=NotFound | |
DEBUG:clap:Parser::is_new_arg: Arg::allow_leading_hyphen(false) | |
DEBUG:clap:Parser::is_new_arg: - found | |
DEBUG:clap:Parser::is_new_arg: starts_new_arg=true | |
DEBUG:clap:Parser::possible_subcommand: arg="-g" | |
DEBUG:clap:Parser::get_matches_with: possible_sc=false, sc=None | |
DEBUG:clap:Parser::parse_short_arg: full_arg="-g" | |
DEBUG:clap:Parser::parse_short_arg:iter:g | |
DEBUG:clap:Parser::parse_short_arg:iter:g: Found valid opt | |
DEBUG:clap:Parser::parse_short_arg:iter:g: p[0]=[], p[1]=[] | |
DEBUG:clap:Parser::parse_opt; opt=flag2, val=None | |
DEBUG:clap:Parser::parse_opt; opt.settings=ArgFlags(EMPTY_VALS | TAKES_VAL | DELIM_NOT_SET) | |
DEBUG:clap:Parser::parse_opt; Checking for val...None | |
DEBUG:clap:ArgMatcher::inc_occurrence_of: arg=flag2 | |
DEBUG:clap:ArgMatcher::inc_occurrence_of: first instance | |
DEBUG:clap:Parser::groups_for_arg: name=flag2 | |
DEBUG:clap:Parser::groups_for_arg: No groups defined | |
DEBUG:clap:Parser::parse_opt: More arg vals required... | |
DEBUG:clap:arg_post_processing!; | |
DEBUG:clap:OptBuilder::fmt:flag2 | |
DEBUG:clap:arg_post_processing!: Is '--flag2 <BRANCH>' in overrides...No | |
DEBUG:clap:OptBuilder::fmt:flag2 | |
DEBUG:clap:arg_post_processing!: Does '--flag2 <BRANCH>' have overrides...No | |
DEBUG:clap:OptBuilder::fmt:flag2 | |
DEBUG:clap:arg_post_processing!: Does '--flag2 <BRANCH>' have conflicts...No | |
DEBUG:clap:OptBuilder::fmt:flag2 | |
DEBUG:clap:arg_post_processing!: Does '--flag2 <BRANCH>' have requirements...No | |
DEBUG:clap:_handle_group_reqs!; | |
DEBUG:clap:Parser:get_matches_with: After parse_short_arg Opt("flag2") | |
DEBUG:clap:Parser::get_matches_with: Begin parsing '"-i"' ([45, 105]) | |
DEBUG:clap:Parser::is_new_arg: arg="-i", Needs Val of=Opt("flag2") | |
DEBUG:clap:Parser::is_new_arg: Arg::allow_leading_hyphen(false) | |
DEBUG:clap:Parser::is_new_arg: - found | |
DEBUG:clap:Parser::is_new_arg: starts_new_arg=true | |
DEBUG:clap:Parser::possible_subcommand: arg="-i" | |
DEBUG:clap:Parser::get_matches_with: possible_sc=false, sc=None | |
DEBUG:clap:Parser::parse_short_arg: full_arg="-i" | |
DEBUG:clap:Parser::parse_short_arg:iter:i | |
DEBUG:clap:Parser::parse_short_arg:iter:i: Found valid opt | |
DEBUG:clap:Parser::parse_short_arg:iter:i: p[0]=[], p[1]=[] | |
DEBUG:clap:Parser::parse_opt; opt=flag3, val=None | |
DEBUG:clap:Parser::parse_opt; opt.settings=ArgFlags(EMPTY_VALS | TAKES_VAL | DELIM_NOT_SET) | |
DEBUG:clap:Parser::parse_opt; Checking for val...None | |
DEBUG:clap:ArgMatcher::inc_occurrence_of: arg=flag3 | |
DEBUG:clap:ArgMatcher::inc_occurrence_of: first instance | |
DEBUG:clap:Parser::groups_for_arg: name=flag3 | |
DEBUG:clap:Parser::groups_for_arg: No groups defined | |
DEBUG:clap:Parser::parse_opt: More arg vals required... | |
DEBUG:clap:arg_post_processing!; | |
DEBUG:clap:OptBuilder::fmt:flag3 | |
DEBUG:clap:arg_post_processing!: Is '--flag3 <BRANCH>' in overrides...No | |
DEBUG:clap:OptBuilder::fmt:flag3 | |
DEBUG:clap:arg_post_processing!: Does '--flag3 <BRANCH>' have overrides...No | |
DEBUG:clap:OptBuilder::fmt:flag3 | |
DEBUG:clap:arg_post_processing!: Does '--flag3 <BRANCH>' have conflicts...No | |
DEBUG:clap:OptBuilder::fmt:flag3 | |
DEBUG:clap:arg_post_processing!: Does '--flag3 <BRANCH>' have requirements...No | |
DEBUG:clap:_handle_group_reqs!; | |
DEBUG:clap:Parser:get_matches_with: After parse_short_arg Opt("flag3") | |
DEBUG:clap:Parser::get_matches_with: Begin parsing '"-s"' ([45, 115]) | |
DEBUG:clap:Parser::is_new_arg: arg="-s", Needs Val of=Opt("flag3") | |
DEBUG:clap:Parser::is_new_arg: Arg::allow_leading_hyphen(false) | |
DEBUG:clap:Parser::is_new_arg: - found | |
DEBUG:clap:Parser::is_new_arg: starts_new_arg=true | |
DEBUG:clap:Parser::possible_subcommand: arg="-s" | |
DEBUG:clap:Parser::get_matches_with: possible_sc=false, sc=None | |
DEBUG:clap:Parser::parse_short_arg: full_arg="-s" | |
DEBUG:clap:Parser::parse_short_arg:iter:s | |
DEBUG:clap:Parser::parse_short_arg:iter:s: Found valid opt | |
DEBUG:clap:Parser::parse_short_arg:iter:s: p[0]=[], p[1]=[] | |
DEBUG:clap:Parser::parse_opt; opt=flag1, val=None | |
DEBUG:clap:Parser::parse_opt; opt.settings=ArgFlags(EMPTY_VALS | TAKES_VAL | DELIM_NOT_SET) | |
DEBUG:clap:Parser::parse_opt; Checking for val...None | |
DEBUG:clap:ArgMatcher::inc_occurrence_of: arg=flag1 | |
DEBUG:clap:ArgMatcher::inc_occurrence_of: first instance | |
DEBUG:clap:Parser::groups_for_arg: name=flag1 | |
DEBUG:clap:Parser::groups_for_arg: No groups defined | |
DEBUG:clap:Parser::parse_opt: More arg vals required... | |
DEBUG:clap:arg_post_processing!; | |
DEBUG:clap:OptBuilder::fmt:flag1 | |
DEBUG:clap:arg_post_processing!: Is '--flag1 <BRANCH>' in overrides...No | |
DEBUG:clap:OptBuilder::fmt:flag1 | |
DEBUG:clap:arg_post_processing!: Does '--flag1 <BRANCH>' have overrides...No | |
DEBUG:clap:OptBuilder::fmt:flag1 | |
DEBUG:clap:arg_post_processing!: Does '--flag1 <BRANCH>' have conflicts...No | |
DEBUG:clap:OptBuilder::fmt:flag1 | |
DEBUG:clap:arg_post_processing!: Does '--flag1 <BRANCH>' have requirements...No | |
DEBUG:clap:_handle_group_reqs!; | |
DEBUG:clap:Parser:get_matches_with: After parse_short_arg Opt("flag1") | |
DEBUG:clap:Parser::get_matches_with: Begin parsing '"-b"' ([45, 98]) | |
DEBUG:clap:Parser::is_new_arg: arg="-b", Needs Val of=Opt("flag1") | |
DEBUG:clap:Parser::is_new_arg: Arg::allow_leading_hyphen(false) | |
DEBUG:clap:Parser::is_new_arg: - found | |
DEBUG:clap:Parser::is_new_arg: starts_new_arg=true | |
DEBUG:clap:Parser::possible_subcommand: arg="-b" | |
DEBUG:clap:Parser::get_matches_with: possible_sc=false, sc=None | |
DEBUG:clap:Parser::parse_short_arg: full_arg="-b" | |
DEBUG:clap:Parser::parse_short_arg:iter:b | |
DEBUG:clap:usage::create_usage_with_title; | |
DEBUG:clap:usage::create_usage_no_title; | |
DEBUG:clap:usage::smart_usage; | |
DEBUG:clap:usage::get_required_usage_from: reqs=["flag3", "flag1", "flag2"], extra=None | |
DEBUG:clap:usage::get_required_usage_from: after init desc_reqs=[] | |
DEBUG:clap:usage::get_required_usage_from: no more children | |
DEBUG:clap:usage::get_required_usage_from: final desc_reqs=["flag1", "flag2", "flag3"] | |
DEBUG:clap:usage::get_required_usage_from: args_in_groups=[] | |
DEBUG:clap:usage::get_required_usage_from:iter:flag1: | |
DEBUG:clap:OptBuilder::fmt:flag1 | |
DEBUG:clap:usage::get_required_usage_from:iter:flag2: | |
DEBUG:clap:OptBuilder::fmt:flag2 | |
DEBUG:clap:usage::get_required_usage_from:iter:flag3: | |
DEBUG:clap:OptBuilder::fmt:flag3 | |
DEBUG:clap:Parser::color; | |
DEBUG:clap:Parser::color: Color setting...Auto | |
DEBUG:clap:is_a_tty: stderr=true | |
DEBUG:clap:Colorizer::error; | |
DEBUG:clap:Colorizer::warning; | |
DEBUG:clap:Colorizer::good; | |
error: Found argument '-b' which wasn't expected, or isn't valid in this context | |
USAGE: | |
test start --flag1 <BRANCH> --flag2 <BRANCH> --flag3 <BRANCH> | |
For more information try --help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment