mirror of
https://github.com/orhun/git-cliff.git
synced 2024-11-11 02:11:52 +03:00
fix(args): require -u or -l flag for prepending changelog
This commit is contained in:
parent
57004a123f
commit
3a42f53c8f
@ -22,6 +22,9 @@ pub enum Error {
|
||||
/// Error that may occur while template operations such as parse and render.
|
||||
#[error("Template error: `{0}`")]
|
||||
TemplateError(#[from] tera::Error),
|
||||
/// Error that may occur while parsing the command line arguments.
|
||||
#[error("Argument error: `{0}`")]
|
||||
ArgumentError(String),
|
||||
}
|
||||
|
||||
/// Result type of the core library.
|
||||
|
@ -5,7 +5,10 @@ use args::Opt;
|
||||
use changelog::Changelog;
|
||||
use git_cliff_core::commit::Commit;
|
||||
use git_cliff_core::config::Config;
|
||||
use git_cliff_core::error::Result;
|
||||
use git_cliff_core::error::{
|
||||
Error,
|
||||
Result,
|
||||
};
|
||||
use git_cliff_core::release::Release;
|
||||
use git_cliff_core::repo::Repository;
|
||||
use std::env;
|
||||
@ -41,6 +44,11 @@ fn main() -> Result<()> {
|
||||
|
||||
if args.changelog.is_some() {
|
||||
config.changelog.footer = None;
|
||||
if !(args.unreleased || args.latest) {
|
||||
return Err(Error::ArgumentError(String::from(
|
||||
"'-u' or '-l' is not specified",
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
let repository =
|
||||
|
Loading…
Reference in New Issue
Block a user