-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back the scenario filter cli option
Fixes: #67
- Loading branch information
Showing
5 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use clap::{App, Arg}; | ||
|
||
#[derive(Default)] | ||
pub struct CliOptions { | ||
pub scenario_filter: Option<String>, | ||
pub nocapture: bool, | ||
} | ||
|
||
pub fn make_app() -> CliOptions { | ||
let matches = App::new("cucumber") | ||
.version(env!("CARGO_PKG_VERSION")) | ||
.author("Brendan Molloy <[email protected]>") | ||
.about("Run the tests, pet a dog!") | ||
.arg( | ||
Arg::with_name("filter") | ||
.short("e") | ||
.long("expression") | ||
.value_name("regex") | ||
.help("Regex to select scenarios from") | ||
.takes_value(true), | ||
) | ||
.arg( | ||
Arg::with_name("nocapture") | ||
.long("nocapture") | ||
.help("Use this flag to disable suppression of output from tests"), | ||
) | ||
.get_matches(); | ||
|
||
let nocapture = matches.is_present("nocapture"); | ||
let scenario_filter = matches.value_of("filter").map(|v| v.to_string()); | ||
|
||
CliOptions { | ||
nocapture, | ||
scenario_filter, | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ pub use gherkin; | |
#[macro_use] | ||
mod macros; | ||
|
||
mod cli; | ||
mod collection; | ||
mod cucumber; | ||
pub mod event; | ||
|
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