mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 12:12:50 +01:00
Rename some things
This commit is contained in:
parent
6517a4bec2
commit
859cd418f0
3 changed files with 8 additions and 8 deletions
|
@ -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)
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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()?)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue