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)
cargo-xtask
Rust project automation command
USAGE:
cargo xtask [OPTIONS] [SUBCOMMAND]
OPTIONS:
-h, --help Print help information
-q, --quiet Less output per occurrence
-v, --verbose More output per occurrence
SUBCOMMANDS:
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
help Print this message or the help of the given subcommand(s)
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
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
sourceimpl Debug for Subcommand
impl Debug for Subcommand
sourceimpl FromArgMatches for Subcommand
impl FromArgMatches for Subcommand
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
sourcefn 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>
sourcefn 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
.sourcefn 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
.sourceimpl Run for Subcommand
impl Run for Subcommand
sourcefn 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.sourcefn to_subcommands(&self) -> Option<SubcommandRun>
fn to_subcommands(&self) -> Option<SubcommandRun>
sourceimpl Subcommand for Subcommand
impl Subcommand for Subcommand
sourcefn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn 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 black(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn bold(&'a self) -> BoldDisplay<'a, Self>
fn bold(&'a self) -> BoldDisplay<'a, Self>
fn dimmed(&'a self) -> DimDisplay<'a, Self>
fn dimmed(&'a self) -> DimDisplay<'a, Self>
fn italic(&'a self) -> ItalicDisplay<'a, Self>
fn italic(&'a self) -> ItalicDisplay<'a, Self>
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
fn blink(&'a self) -> BlinkDisplay<'a, Self>
fn blink(&'a self) -> BlinkDisplay<'a, Self>
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough(&'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 morefn 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