Skip to content

Commit aa106ac

Browse files
committed
Bump version to 2.0.0
1 parent 940f081 commit aa106ac

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ documentation = "https://docs.rs/cmd_lib"
88
keywords = ["shell", "script", "cli", "process", "pipe"]
99
categories = ["command-line-interface", "command-line-utilities"]
1010
readme = "README.md"
11-
version = "1.9.6"
11+
version = "2.0.0"
1212
authors = ["rust-shell-script <rust-shell-script@gmail.com>"]
1313
edition = "2024"
1414
rust-version = "1.88"
@@ -17,19 +17,19 @@ rust-version = "1.88"
1717
members = ["macros"]
1818

1919
[dependencies]
20-
cmd_lib_macros = { version = "1.9.6", path = "./macros" }
21-
log = "0.4.20"
20+
cmd_lib_macros = { version = "2.0.0", path = "./macros" }
21+
log = "0.4.27"
2222
faccess = "0.2.4"
23-
os_pipe = "1.1.4"
24-
env_logger = "0.10.0"
23+
os_pipe = "1.2.2"
24+
env_logger = "0.11.8"
2525
build-print = { version = "1.0", optional = true }
2626
tracing = { version = "0.1.41", optional = true }
2727

2828
[dev-dependencies]
29-
rayon = "1.8.0"
29+
rayon = "1.11.0"
3030
clap = { version = "4", features = ["derive"] }
3131
byte-unit = "4.0.19"
32-
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
32+
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
3333

3434
[features]
3535
build-print = ["dep:build-print"]

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,9 @@ run_cmd! {
105105

106106
```rust
107107
let version = run_fun!(rustc --version | awk r"{print $2}")?;
108-
eprintln!("Your rust version is {}", version);
108+
info!("Your rust version is {version}");
109109

110-
// with pipes
111-
let n = run_fun!(echo "the quick brown fox jumped over the lazy dog" | wc -w)?;
112-
eprintln!("There are {} words in above sentence", n);
113-
```
114-
115-
#### Abstraction without overhead
110+
### Abstraction without overhead
116111

117112
Since all the macros' lexical analysis and syntactic analysis happen at compile time, it can
118113
basically generate code the same as calling `std::process` APIs manually. It also includes
@@ -122,13 +117,13 @@ commands being used.
122117
123118
You can use `cargo expand` to check the generated code.
124119
125-
#### Intuitive parameters passing
120+
### Intuitive parameters passing
126121
When passing parameters to `run_cmd!` and `run_fun!` macros, if they are not part to rust
127122
[String literals](https://doc.rust-lang.org/reference/tokens.html#string-literals), they will be
128123
converted to string as an atomic component, so you don't need to quote them. The parameters will be
129124
like `$a` or `${a}` in `run_cmd!` or `run_fun!` macros.
130125

131-
```rust
126+
```no_run
132127
let dir = "my folder";
133128
run_cmd!(echo "Creating $dir at /tmp")?;
134129
run_cmd!(mkdir -p /tmp/$dir)?;

macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
55
homepage = "https://github.com/rust-shell-script/rust_cmd_lib"
66
repository = "https://github.com/rust-shell-script/rust_cmd_lib"
77
keywords = ["shell", "script", "cli", "process", "pipe"]
8-
version = "1.9.6"
8+
version = "2.0.0"
99
authors = ["Tao Guo <tao.guo.code@gmail.com>"]
1010
edition = "2024"
1111
rust-version = "1.88"

src/lib.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,7 @@
115115
//! ```
116116
//! # use cmd_lib::run_fun;
117117
//! let version = run_fun!(rustc --version | awk r"{print $2}")?;
118-
//! eprintln!("Your rust version is {}", version);
119-
//!
120-
//! // with pipes
121-
//! let n = run_fun!(echo "the quick brown fox jumped over the lazy dog" | wc -w)?;
122-
//! eprintln!("There are {} words in above sentence", n);
123-
//! # Ok::<(), std::io::Error>(())
124-
//! ```
118+
//! info!("Your rust version is {version}");
125119
//!
126120
//! ### Abstraction without overhead
127121
//!
@@ -399,8 +393,8 @@ pub use log as inner_log;
399393
#[doc(hidden)]
400394
pub use logger::try_init_default_logger;
401395
#[doc(hidden)]
402-
pub use process::{AsOsStr, Cmd, CmdString, Cmds, GroupCmds, Redirect, register_cmd};
403-
pub use process::{CmdEnv, ScopedDebug, ScopedPipefail, set_debug, set_pipefail};
396+
pub use process::{register_cmd, AsOsStr, Cmd, CmdString, Cmds, GroupCmds, Redirect};
397+
pub use process::{set_debug, set_pipefail, CmdEnv, ScopedDebug, ScopedPipefail};
404398

405399
mod builtins;
406400
mod child;

0 commit comments

Comments
 (0)