mirror of
https://github.com/orhun/git-cliff.git
synced 2024-12-15 14:32:59 +03:00
refactor(args): add possible values to strip argument
This commit is contained in:
parent
05d522985b
commit
57004a123f
@ -44,9 +44,9 @@ pub struct Opt {
|
||||
/// Processes the commits that do not belong to a tag.
|
||||
#[structopt(short, long)]
|
||||
pub unreleased: bool,
|
||||
/// Strips the header and footer from the changelog.
|
||||
#[structopt(short, long)]
|
||||
pub strip: bool,
|
||||
/// Strips the given parts from the changelog.
|
||||
#[structopt(short, long, possible_values = &["header", "footer", "all"])]
|
||||
pub strip: Option<String>,
|
||||
/// Sets the commit range to process.
|
||||
pub range: Option<String>,
|
||||
}
|
||||
|
@ -25,10 +25,21 @@ fn main() -> Result<()> {
|
||||
pretty_env_logger::init();
|
||||
let mut config = Config::parse(args.config)?;
|
||||
|
||||
if args.strip {
|
||||
match args.strip.as_deref() {
|
||||
Some("header") => {
|
||||
config.changelog.header = None;
|
||||
}
|
||||
Some("footer") => {
|
||||
config.changelog.footer = None;
|
||||
}
|
||||
Some("all") => {
|
||||
config.changelog.header = None;
|
||||
config.changelog.footer = None;
|
||||
} else if args.changelog.is_some() {
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
if args.changelog.is_some() {
|
||||
config.changelog.footer = None;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user