From 0c44c77144a1fec962883a46c17aae69d05f85cc Mon Sep 17 00:00:00 2001 From: bestgopher <84328409@qq.com> Date: Thu, 13 Jan 2022 14:56:45 +0800 Subject: [PATCH] v1.0.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++--- src/command.rs | 2 +- 4 files changed, 45 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6bd9660..6ca6aca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,7 +157,7 @@ dependencies = [ [[package]] name = "cargo-rclean" -version = "0.1.0" +version = "1.0.0" dependencies = [ "anyhow", "cargo", diff --git a/Cargo.toml b/Cargo.toml index c410c6b..59843ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-rclean" -version = "0.1.0" +version = "1.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index 51af65a..2fdf6ca 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # cargo-rclean -cargo clean recursively +Execute `cargo clean` for all cargo projects in the directory. # install ```shell ➜ cargo install --git https://github.com/bestgopher/cargo-rclean +➜ cargo install cargo-rclean ``` # usage @@ -11,5 +12,43 @@ cargo clean recursively ➜ cargo rclean ``` -# todo -- [ ] output logs \ No newline at end of file +# Examples +There are three cargo projects in current working directory: +```shell +➜ tree -L 2 +. +├── rclean_test_1 +│   ├── Cargo.lock +│   ├── Cargo.toml +│   ├── src +│   └── target +├── rclean_test_2 +│   ├── Cargo.lock +│   ├── Cargo.toml +│   ├── src +│   └── target +└── rclean_test_3 + ├── Cargo.lock + ├── Cargo.toml + ├── src + └── target +``` +Then I execute: `cargo rclean` : +```shell +➜ tree -L 2 +. +├── rclean_test_1 +│   ├── Cargo.lock +│   ├── Cargo.toml +│   └── src +├── rclean_test_2 +│   ├── Cargo.lock +│   ├── Cargo.toml +│   └── src +└── rclean_test_3 + ├── Cargo.lock + ├── Cargo.toml + └── src + +``` +All targets have been removed. diff --git a/src/command.rs b/src/command.rs index 68e4849..8f5adf5 100644 --- a/src/command.rs +++ b/src/command.rs @@ -8,7 +8,7 @@ use itertools::Itertools; #[derive(Parser)] #[clap(bin_name = "cargo", version, author)] pub enum Opts { - /// Show the result of macro expansion. + /// Execute `cargo clean` for all cargo projects in the directory #[clap( name = "rclean", version,