Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 10, 2024
1 parent c1b6bdf commit 7701bd4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/src/cli/complete_word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl CompleteWord {
ctx.insert("PREV", &(cword - 1));

let parsed = parse(spec, words)?;
debug!("parsed cmd: {}", parsed.cmd.full_cmd.join(" "));
let choices = if !parsed.cmd.subcommands.is_empty() {
complete_subcommands(parsed.cmd, &ctoken)
} else if ctoken == "-" {
Expand Down Expand Up @@ -274,7 +275,8 @@ fn complete_subcommands(cmd: &SpecCommand, ctoken: &str) -> Vec<String> {
}

fn complete_long_flag_names(flags: &BTreeMap<String, SpecFlag>, ctoken: &str) -> Vec<String> {
trace!("complete_long_flag_names: {ctoken}");
debug!("complete_long_flag_names: {ctoken}");
trace!("flags: {}", flags.keys().join(", "));
let ctoken = ctoken.strip_prefix("--").unwrap_or(ctoken);
flags
.values()
Expand All @@ -288,7 +290,7 @@ fn complete_long_flag_names(flags: &BTreeMap<String, SpecFlag>, ctoken: &str) ->
}

fn complete_short_flag_names(flags: &BTreeMap<String, SpecFlag>, ctoken: &str) -> Vec<String> {
trace!("complete_short_flag_names: {ctoken}");
debug!("complete_short_flag_names: {ctoken}");
let cur = ctoken.chars().nth(1);
flags
.values()
Expand Down

0 comments on commit 7701bd4

Please sign in to comment.