diff options
| author | datdenkikniet <jcdra1@gmail.com> | 2023-04-15 20:57:27 +0200 |
|---|---|---|
| committer | datdenkikniet <jcdra1@gmail.com> | 2023-04-16 13:08:46 +0200 |
| commit | 859cd418f063590a9928b3e43caeea0b53dc0823 (patch) | |
| tree | 8b3fe69e04ef07038928c87370d2361392f81123 | |
| parent | 6517a4bec2e909b40eb9974e063f95e44e4d9a31 (diff) | |
Rename some things
| -rw-r--r-- | xtask/src/argument_parsing.rs | 8 | ||||
| -rw-r--r-- | xtask/src/command.rs | 6 | ||||
| -rw-r--r-- | xtask/src/main.rs | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index d74ba69..6cae186 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -304,24 +304,24 @@ pub enum Commands { /// Check one or more usage examples. /// /// Usage examples are located in ./examples - UsageExamplesCheck(UsageExamples), + UsageExampleCheck(UsageExamplesOpt), /// Build one or more usage examples. /// /// Usage examples are located in ./examples #[clap(alias = "./examples")] - UsageExampleBuild(UsageExamples), + UsageExampleBuild(UsageExamplesOpt), } #[derive(Args, Clone, Debug)] -pub struct UsageExamples { +pub struct UsageExamplesOpt { /// The usage examples to build. All usage examples are selected if this argument is not provided. /// /// Example: `rp2040_local_i2c_init,stm32f3_blinky`. examples: Option<String>, } -impl UsageExamples { +impl UsageExamplesOpt { pub fn examples(&self) -> anyhow::Result<Vec<String>> { let usage_examples: Vec<_> = std::fs::read_dir("./examples")? .filter_map(Result::ok) diff --git a/xtask/src/command.rs b/xtask/src/command.rs index 93ea824..a1c4d25 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -831,16 +831,16 @@ pub fn handle_results(globals: &Globals, results: Vec<FinalRunResult>) -> Result }; if globals.verbose > 0 { - info!("✅ Success:{path} {cmd}\n {}", cmd.as_cmd_string()); + info!("✅ Success: {cmd}{path}\n {}", cmd.as_cmd_string()); } else { - info!("✅ Success:{path} {cmd}"); + info!("✅ Success:{cmd}{path}"); } }); errors.clone().for_each(|(cmd, _, _)| { if let Some(dir) = cmd.chdir() { let path = dir.as_os_str().to_str().unwrap_or("Not displayable"); - error!("❌ Failed: (in {path}) {cmd}\n {}", cmd.as_cmd_string()); + error!("❌ Failed: {cmd} (in {path}) \n {}", cmd.as_cmd_string()); } else { error!("❌ Failed: {cmd}\n {}", cmd.as_cmd_string()); } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 4cf6db8..10499c0 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -288,7 +288,7 @@ fn main() -> anyhow::Result<()> { info!("Running mdbook"); cargo_book(globals, &args.arguments) } - Commands::UsageExamplesCheck(examples) => { + Commands::UsageExampleCheck(examples) => { info!("Checking usage examples"); cargo_usage_example(globals, BuildOrCheck::Check, examples.examples()?) } |
