pub struct ConvergenceArgs {
pub repo: RepoArgs,
pub format: OutputFormat,
pub all: bool,
}Expand description
majordomus convergence: whether any of this repository’s work is held where only one
disk can see it. It exits 10 when it is, so a hook or a script refuses on the verdict
rather than on a parsed report.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, ConvergenceArgs, OutputFormat};
let cli = Cli::try_parse_from(["majordomus", "convergence", "--format", "json", "--all"])
.unwrap();
let args: ConvergenceArgs = match cli.command {
Command::Convergence(args) => args,
other => panic!("expected `convergence`, parsed {other:?}"),
};
assert!(matches!(args.format, OutputFormat::Json));
assert!(args.all);
// a person asks the question with nothing after it, and reads only what is at risk
let bare = Cli::try_parse_from(["majordomus", "convergence"]).unwrap();
assert!(matches!(bare.command, Command::Convergence(ConvergenceArgs { all: false, .. })));Fields§
§repo: RepoArgsWhere and how the repository is read.
format: OutputFormatHow to render the verdict
all: boolList every holding, not only the ones whose work exists on one disk
Trait Implementations§
Source§impl Args for ConvergenceArgs
impl Args for ConvergenceArgs
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 ConvergenceArgs
impl Debug for ConvergenceArgs
Source§impl FromArgMatches for ConvergenceArgs
impl FromArgMatches for ConvergenceArgs
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 ConvergenceArgs
impl RefUnwindSafe for ConvergenceArgs
impl Send for ConvergenceArgs
impl Sync for ConvergenceArgs
impl Unpin for ConvergenceArgs
impl UnsafeUnpin for ConvergenceArgs
impl UnwindSafe for ConvergenceArgs
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