pub enum PackCommand {
Plan {
profile: Option<String>,
},
Build {
profile: Option<String>,
out: Option<PathBuf>,
force: bool,
},
Verify {
dir: String,
},
}Expand description
The subcommands of majordomus pack: plan is the verdict before anything is written,
build writes the pack and verifies what it wrote, and verify reads a written pack.
use majordomus_cli::cli::{Cli, Command, PackCommand};
use clap::Parser;
let cli = Cli::try_parse_from(["majordomus", "pack", "build", "--out", "tmp/p", "--force"]).unwrap();
let Command::Pack(args) = cli.command else { panic!("not the pack command") };
assert!(matches!(args.command, PackCommand::Build { force: true, .. }));Variants§
Plan
What a profile would pack: files carried, files left out by reason, the shards and every finding that refuses the build; exit 10 on a finding, 12 when the tree cannot be read
Build
Write the pack (index, shards, pack.json) and verify what was written; exit 10 when the plan or the written pack has a finding, and nothing is built from a plan with one
Fields
Verify
Verify a written pack against its manifest and the profile it names; exit 10 on a finding, 12 when the manifest cannot be read
Trait Implementations§
Source§impl Debug for PackCommand
impl Debug for PackCommand
Source§impl FromArgMatches for PackCommand
impl FromArgMatches for PackCommand
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<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Subcommand for PackCommand
impl Subcommand for PackCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for PackCommand
impl RefUnwindSafe for PackCommand
impl Send for PackCommand
impl Sync for PackCommand
impl Unpin for PackCommand
impl UnsafeUnpin for PackCommand
impl UnwindSafe for PackCommand
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