Enum cli_xtask::subcommand::Subcommand
source · #[non_exhaustive]pub enum Subcommand {
Show 22 variants
Build(Build),
Clippy(Clippy),
Dist(Dist),
DistArchive(DistArchive),
DistBuild(DistBuild),
DistBuildBin(DistBuildBin),
DistBuildCompletion(DistBuildCompletion),
DistBuildDoc(DistBuildDoc),
DistBuildLicense(DistBuildLicense),
DistBuildMan(DistBuildMan),
DistBuildReadme(DistBuildReadme),
DistClean(DistClean),
Doc(Doc),
Docsrs(Docsrs),
Exec(Exec),
Fmt(Fmt),
Lint(Lint),
PreRelease(PreRelease),
SyncRdme(SyncRdme),
Test(Test),
Tidy(Tidy),
Udeps(Udeps),
}Expand description
Subcommand definition for cargo xtask command.
cargo-xtask(1)
Rust project automation command
Usage: cargo xtask [OPTIONS] [COMMAND]
Commands:
build `cargo build` with options useful for testing and continuous integration
clippy `cargo clippy` with options useful for tesing and continuous integration
dist Build the artifacs and create the archive file for distribution
dist-archive Create the archive file for distribution
dist-build Build all artifacts for distribution
dist-build-bin Build the release binaries for distribution
dist-build-completion Build the shell completion files for distribution
dist-build-doc Build the documentation for distribution
dist-build-license Build the license files for distribution
dist-build-man Build the man pages for distribution
dist-build-readme Build the readme files for distribution
dist-clean Remove the artifacts and archives for distribution
doc `cargo doc` with options useful for testing and continuous integration
docsrs `cargo doc` with docs.rs specific options
exec Run commands on all workspaces in the current directory and subdirectories
fmt `cargo fmt` with options useful for testing and continuous integration
lint Run lint commands at once
pre-release Run pre-release checks
sync-rdme `cargo sync-rdme` with options useful for testing and continuous integration
test `cargo test` with options useful for testing and continuous integration
tidy Fix the package problems
udeps `cargo udeps` with options useful for testing and continuous integration
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose... More output per occurrence
-q, --quiet... Less output per occurrence
-h, --help Print help
Examples
You can use this struct to define a subcommand of your application:
use cli_xtask::{clap, config::Config, subcommand::Subcommand, Result};
#[derive(Debug, clap::Parser)]
struct App {
#[clap(subcommand)]
subcommand: Subcommand,
}
impl App {
pub fn run(&self, config: &Config) -> Result<()> {
self.subcommand.run(config)
}
}You can mix the subcommands defined in this enum with your own subcommands:
use cli_xtask::{clap, config::Config, Result};
#[derive(Debug, clap::Parser)]
struct App {
#[clap(subcommand)]
subcommand: YourOwnSubcommand,
}
#[derive(Debug, clap::Subcommand)]
enum YourOwnSubcommand {
#[clap(flatten)]
Predefined(cli_xtask::subcommand::Subcommand),
Foo,
Bar,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Build(Build)
subcommand-build only.cargo build with options useful for testing and continuous
integration.
Clippy(Clippy)
subcommand-clippy only.cargo clippy with options useful for tesing and continuous
integration.
Dist(Dist)
subcommand-dist only.Build the artifacs and create the archive file for distribution.
DistArchive(DistArchive)
subcommand-dist-archive only.Create the archive file for distribution.
DistBuild(DistBuild)
subcommand-dist-build-* only.Build all artifacts for distribution.
DistBuildBin(DistBuildBin)
subcommand-dist-build-bin only.Build the release binaries for distribution.
DistBuildCompletion(DistBuildCompletion)
subcommand-dist-build-completion only.Build the shell completion files for distribution.
DistBuildDoc(DistBuildDoc)
subcommand-dist-build-doc only.Build the documentation for distribution.
DistBuildLicense(DistBuildLicense)
subcommand-dist-build-license only.Build the license files for distribution.
DistBuildMan(DistBuildMan)
subcommand-dist-build-man only.Build the man pages for distribution.
DistBuildReadme(DistBuildReadme)
subcommand-dist-build-readme only.Build the readme files for distribution.
DistClean(DistClean)
subcommand-dist-clean only.Remove the artifacts and archives for distribution.
Doc(Doc)
subcommand-doc only.cargo doc with options useful for testing and continuous integration.
Docsrs(Docsrs)
subcommand-docsrs only.cargo doc with docs.rs specific options.
Exec(Exec)
subcommand-exec only.Run commands on all workspaces in the current directory and subdirectories.
Fmt(Fmt)
subcommand-fmt only.cargo fmt with options useful for testing and continuous integration.
Lint(Lint)
subcommand-lint only.Run lint commands at once.
PreRelease(PreRelease)
subcommand-pre-release only.Run pre-release checks.
SyncRdme(SyncRdme)
subcommand-syncrdme only.cargo sync-rdme with options useful for testing and continuous
integration.
Test(Test)
subcommand-test only.cargo test with options useful for testing and continuous integration.
Tidy(Tidy)
subcommand-tidy only.Fix the package problems.
Udeps(Udeps)
subcommand-udeps only.cargo udeps with options useful for testing and continuous
integration.
Implementations§
Trait Implementations§
source§impl Debug for Subcommand
impl Debug for Subcommand
source§impl FromArgMatches for Subcommand
impl FromArgMatches for Subcommand
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>
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>
ArgMatches to self.source§impl Run for Subcommand
impl Run for Subcommand
source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&dyn Run trait object to a mutable concrete type.source§fn to_subcommands(&self) -> Option<SubcommandRun>
fn to_subcommands(&self) -> Option<SubcommandRun>
source§impl Subcommand for Subcommand
impl Subcommand for Subcommand
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
source§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl RefUnwindSafe for Subcommand
impl Send for Subcommand
impl Sync for Subcommand
impl Unpin for Subcommand
impl UnwindSafe for Subcommand
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more