pub struct EconomicsSummaryArgs {
pub repo: RepoArgs,
pub format: OutputFormat,
pub suite: Option<String>,
pub category: Option<String>,
pub task: Option<String>,
pub model: Option<String>,
}Expand description
majordomus economics summary. Every filter is optional and they combine as a
conjunction. They narrow the pairs and the metrics computed from them; the verdict is
always stated over all the live evidence, so a narrowed view cannot make publishable a
statement the whole evidence does not support.
use clap::Parser;
use majordomus_cli::cli::{
Cli, Command, EconomicsCommand, EconomicsSummaryArgs, OutputFormat,
};
fn summary_of(argv: &[&str]) -> EconomicsSummaryArgs {
let cli = Cli::try_parse_from(argv.iter().copied()).unwrap();
let Command::Economics(args) = cli.command else { panic!("economics") };
let EconomicsCommand::Summary(summary) = args.command else { panic!("summary") };
summary
}
let s = summary_of(&[
"majordomus", "economics", "summary", "--suite", "pilot", "--category", "bug-fix",
"--format", "json",
]);
assert_eq!(s.suite.as_deref(), Some("pilot"));
assert_eq!(s.category.as_deref(), Some("bug-fix"));
assert_eq!(s.format, OutputFormat::Json);
// a filter not named is no filter
assert!(s.task.is_none() && s.model.is_none());Fields§
§repo: RepoArgsWhere and how the repository is read.
format: OutputFormatOutput shape
suite: Option<String>Only this suite
category: Option<String>Only tasks of this category
task: Option<String>Only this task
model: Option<String>Only runs that asked for this model
Trait Implementations§
Source§impl Args for EconomicsSummaryArgs
impl Args for EconomicsSummaryArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl Debug for EconomicsSummaryArgs
impl Debug for EconomicsSummaryArgs
Source§impl FromArgMatches for EconomicsSummaryArgs
impl FromArgMatches for EconomicsSummaryArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl Freeze for EconomicsSummaryArgs
impl RefUnwindSafe for EconomicsSummaryArgs
impl Send for EconomicsSummaryArgs
impl Sync for EconomicsSummaryArgs
impl Unpin for EconomicsSummaryArgs
impl UnsafeUnpin for EconomicsSummaryArgs
impl UnwindSafe for EconomicsSummaryArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more