pub struct EconomicsReferencesArgs {
pub repo: RepoArgs,
pub work_dir: Option<PathBuf>,
}Expand description
majordomus economics references. Proves every task can fail: its hidden tests must
fail on the starting fixture and pass once the reference solution is applied, or a
failed run would say nothing about the agent. No model is called; the workspaces are
built on this machine, under the system temporary directory unless --work-dir names
another, and a task that breaks the rule makes the command exit 10.
use std::path::Path;
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, EconomicsCommand, EconomicsReferencesArgs};
fn references_of(argv: &[&str]) -> EconomicsReferencesArgs {
let cli = Cli::try_parse_from(argv.iter().copied()).unwrap();
let Command::Economics(args) = cli.command else { panic!("economics") };
let EconomicsCommand::References(r) = args.command else { panic!("references") };
r
}
assert!(references_of(&["majordomus", "economics", "references"]).work_dir.is_none());
let placed = references_of(&[
"majordomus", "economics", "references", "--work-dir", "scratch/refs",
]);
assert_eq!(placed.work_dir.as_deref(), Some(Path::new("scratch/refs")));Fields§
§repo: RepoArgsWhere and how the repository is read.
work_dir: Option<PathBuf>Where the workspaces go
Trait Implementations§
Source§impl Args for EconomicsReferencesArgs
impl Args for EconomicsReferencesArgs
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 EconomicsReferencesArgs
impl Debug for EconomicsReferencesArgs
Source§impl FromArgMatches for EconomicsReferencesArgs
impl FromArgMatches for EconomicsReferencesArgs
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 EconomicsReferencesArgs
impl RefUnwindSafe for EconomicsReferencesArgs
impl Send for EconomicsReferencesArgs
impl Sync for EconomicsReferencesArgs
impl Unpin for EconomicsReferencesArgs
impl UnsafeUnpin for EconomicsReferencesArgs
impl UnwindSafe for EconomicsReferencesArgs
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