This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users can now use the --against argument to specify against which commit/tag/branch the current api must be compared against.
- Loading branch information
Sasha Pourcelot
committed
Jun 9, 2021
1 parent
d721d00
commit 1547dc0
Showing
5 changed files
with
126 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ anyhow = "1.0" | |
git2 = "0.13" | ||
cargo_toml = "0.9" | ||
semver = "1.0" | ||
clap = "2.33" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use clap::{crate_authors, crate_description, crate_name, crate_version, App, Arg}; | ||
|
||
pub(crate) struct ProgramConfig { | ||
pub comparaison_ref: String, | ||
} | ||
|
||
impl ProgramConfig { | ||
pub(crate) fn parse() -> ProgramConfig { | ||
let matches = App::new(crate_name!()) | ||
.version(crate_version!()) | ||
.author(crate_authors!()) | ||
.about(crate_description!()) | ||
.arg( | ||
Arg::with_name("against") | ||
.short("a") | ||
.help("Sets the git reference to compare the API against. Can be a tag, a branch name or a commit.") | ||
.takes_value(true) | ||
.required(false) | ||
.default_value("main") | ||
).get_matches(); | ||
|
||
let comparaison_ref = matches.value_of("against").unwrap().to_owned(); | ||
|
||
ProgramConfig { comparaison_ref } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters