pub struct SkillsArgs {
pub repo: RepoArgs,
pub command: SkillsCommand,
pub format: OutputFormat,
}Expand description
majordomus skills. The output shape is global, so it reads where a person writes it.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, OutputFormat, SkillsArgs, SkillsCommand};
let cli = Cli::try_parse_from(["majordomus", "skills", "explain", "implement"]).unwrap();
let Command::Skills(args) = cli.command else { panic!("skills") };
let args: SkillsArgs = args;
assert!(matches!(args.command, SkillsCommand::Explain { .. }));
assert_eq!(args.format, OutputFormat::Text, "text unless a person asks for json");
// `--format` is global, so it is read after the subcommand as well as before it
let cli = Cli::try_parse_from(["majordomus", "skills", "status", "--format", "json"]).unwrap();
let Command::Skills(SkillsArgs { format, .. }) = cli.command else { panic!("skills") };
assert_eq!(format, OutputFormat::Json);
// the group runs nothing of its own: every runnable path here is a capability's
assert!(Cli::try_parse_from(["majordomus", "skills"]).is_err());Fields§
§repo: RepoArgsWhere and how the repository is read.
command: SkillsCommandstatus, explain or verify.
format: OutputFormatOutput shape
Trait Implementations§
Source§impl Args for SkillsArgs
impl Args for SkillsArgs
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 SkillsArgs
impl Debug for SkillsArgs
Source§impl FromArgMatches for SkillsArgs
impl FromArgMatches for SkillsArgs
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 SkillsArgs
impl RefUnwindSafe for SkillsArgs
impl Send for SkillsArgs
impl Sync for SkillsArgs
impl Unpin for SkillsArgs
impl UnsafeUnpin for SkillsArgs
impl UnwindSafe for SkillsArgs
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