Skip to content

Commit

Permalink
fix(debug): Improve debug output of bin building
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Apr 29, 2022
1 parent bcde91b commit 515a37d
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/build/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4102,12 +4102,12 @@ impl<'help> App<'help> {
sc_names = format!("{{{}}}", sc_names);
}

sc.usage_name = Some(
self.bin_name
.as_ref()
.map(|bin_name| format!("{}{}{}", bin_name, mid_string, sc_names))
.unwrap_or(sc_names),
);
let usage_name = self
.bin_name
.as_ref()
.map(|bin_name| format!("{}{}{}", bin_name, mid_string, sc_names))
.unwrap_or(sc_names);
sc.usage_name = Some(usage_name);

// bin_name should be parent's bin_name + [<reqs>] + the sc's name separated by
// a space
Expand All @@ -4132,25 +4132,23 @@ impl<'help> App<'help> {
debug!("Command::_build_bin_names:iter: bin_name set...");

if sc.bin_name.is_none() {
debug!("No");
let bin_name = format!(
"{}{}{}",
self.bin_name.as_ref().unwrap_or(&self.name),
if self.bin_name.is_some() { " " } else { "" },
&*sc.name
);
debug!(
"Command::_build_bin_names:iter: Setting bin_name of {} to {}",
self.name, bin_name
"Command::_build_bin_names:iter: Setting bin_name of {} to {:?}",
sc.name, bin_name
);
sc.bin_name = Some(bin_name);
} else {
debug!("yes ({:?})", sc.bin_name);
debug!(
"Command::_build_bin_names::iter: Using existing bin_name of {} ({:?})",
sc.name, sc.bin_name
);
}
debug!(
"Command::_build_bin_names:iter: Calling build_bin_names from...{}",
sc.name
);
sc._build_bin_names_internal();
}
self.set(AppSettings::BinNameBuilt);
Expand Down

0 comments on commit 515a37d

Please sign in to comment.