Skip to content

Commit

Permalink
feat(help): Write help to string
Browse files Browse the repository at this point in the history
  • Loading branch information
ychiguer committed Jun 28, 2022
1 parent abbac12 commit 68c701b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/output/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ macro_rules! write_method {
Ok(())
}
HelpWriter::Normal(w) => w.write_all($msg.as_ref()),
HelpWriter::String(s) => {
s.push_str($msg.into().as_str());
Ok(())
}
}
};
}
Expand Down Expand Up @@ -1117,6 +1121,7 @@ const TAB_WIDTH: usize = 4;
pub(crate) enum HelpWriter<'writer> {
Normal(&'writer mut dyn Write),
Buffer(&'writer mut Colorizer),
String(&'writer mut String),
}

fn should_show_arg(use_long: bool, arg: &Arg) -> bool {
Expand Down

0 comments on commit 68c701b

Please sign in to comment.