pub struct EconomicsCheckArgs {
pub repo: RepoArgs,
pub format: OutputFormat,
}Expand description
majordomus economics check. It takes no filter, because a gate that could be narrowed
could be narrowed past the claim it exists to refuse. It exits 10 when it finds a
quantity stated beside the economics vocabulary in hand-written prose, or a bound claim
whose evidence does not stand.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, EconomicsCheckArgs, EconomicsCommand, OutputFormat};
fn check_of(argv: &[&str]) -> EconomicsCheckArgs {
let cli = Cli::try_parse_from(argv.iter().copied()).unwrap();
let Command::Economics(args) = cli.command else { panic!("economics") };
let EconomicsCommand::Check(check) = args.command else { panic!("check") };
check
}
assert_eq!(check_of(&["majordomus", "economics", "check"]).format, OutputFormat::Text);
let json = check_of(&["majordomus", "economics", "check", "--format", "json"]);
assert_eq!(json.format, OutputFormat::Json);
// nothing narrows the gate
assert!(Cli::try_parse_from(["majordomus", "economics", "check", "--suite", "x"]).is_err());Fields§
§repo: RepoArgsWhere and how the repository is read.
format: OutputFormatOutput shape
Trait Implementations§
Source§impl Args for EconomicsCheckArgs
impl Args for EconomicsCheckArgs
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 EconomicsCheckArgs
impl Debug for EconomicsCheckArgs
Source§impl FromArgMatches for EconomicsCheckArgs
impl FromArgMatches for EconomicsCheckArgs
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 EconomicsCheckArgs
impl RefUnwindSafe for EconomicsCheckArgs
impl Send for EconomicsCheckArgs
impl Sync for EconomicsCheckArgs
impl Unpin for EconomicsCheckArgs
impl UnsafeUnpin for EconomicsCheckArgs
impl UnwindSafe for EconomicsCheckArgs
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