From 3908cbf7e8f3a0e7da7dbe132afd387f227a8a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 2 Mar 2023 22:02:19 +0100 Subject: xtask: Allow passing arguments to book and doc --- xtask/src/argument_parsing.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'xtask/src/argument_parsing.rs') diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index aff464c..1fc06c1 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -185,7 +185,7 @@ pub enum Commands { /// arguments will be passed on /// /// Example: `cargo xtask size -- -A` - Size(Size), + Size(Arg), /// Run examples in QEMU and compare against expected output /// @@ -204,13 +204,18 @@ pub enum Commands { Run(QemuAndRun), /// Build docs - Doc, + /// + /// To pass options to `cargo doc`, add `--` and then the following + /// arguments will be passed on + /// + /// Example: `cargo xtask doc -- --open` + Doc(Arg), /// Run tests Test(PackageOpt), /// Build books with mdbook - Book, + Book(Arg), } #[derive(Args, Debug)] @@ -232,14 +237,14 @@ pub struct QemuAndRun { } #[derive(Debug, Parser)] -pub struct Size { +pub struct Arg { /// Options to pass to `cargo size` #[command(subcommand)] - pub sizearguments: Option, + pub arguments: Option, } #[derive(Clone, Debug, PartialEq, Parser)] -pub enum Sizearguments { +pub enum ExtraArguments { /// All remaining flags and options #[command(external_subcommand)] Other(Vec), -- cgit v1.2.3