Skip to content

Commit 7701bd4

Browse files
committed
logging
1 parent c1b6bdf commit 7701bd4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/src/cli/complete_word.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl CompleteWord {
6565
ctx.insert("PREV", &(cword - 1));
6666

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

276277
fn complete_long_flag_names(flags: &BTreeMap<String, SpecFlag>, ctoken: &str) -> Vec<String> {
277-
trace!("complete_long_flag_names: {ctoken}");
278+
debug!("complete_long_flag_names: {ctoken}");
279+
trace!("flags: {}", flags.keys().join(", "));
278280
let ctoken = ctoken.strip_prefix("--").unwrap_or(ctoken);
279281
flags
280282
.values()
@@ -288,7 +290,7 @@ fn complete_long_flag_names(flags: &BTreeMap<String, SpecFlag>, ctoken: &str) ->
288290
}
289291

290292
fn complete_short_flag_names(flags: &BTreeMap<String, SpecFlag>, ctoken: &str) -> Vec<String> {
291-
trace!("complete_short_flag_names: {ctoken}");
293+
debug!("complete_short_flag_names: {ctoken}");
292294
let cur = ctoken.chars().nth(1);
293295
flags
294296
.values()

0 commit comments

Comments
 (0)