Skip to content

Commit 6019297

Browse files
committed
Update to beta of clap 3 and improve arg handling
1 parent edcad02 commit 6019297

14 files changed

+280
-147
lines changed

Cargo.lock

Lines changed: 99 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name = "rust-script"
33
version = "0.7.0"
44
edition = "2018"
55
authors = ["Fredrik Fornwall <fredrik@fornwall.net>"]
6-
76
description = "Command-line tool to run Rust \"scripts\" which can make use of crates."
87
homepage = "https://rust-script.org"
98
documentation = "https://rust-script.org"
@@ -22,7 +21,7 @@ exclude = [
2221

2322
[dependencies]
2423
crossbeam-channel = "0.5"
25-
clap = "2"
24+
clap = "3.0.0-beta.2"
2625
dirs-next = "2"
2726
env_logger = "0.8"
2827
lazy_static = "1"

examples/hello-without-main.ers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env rust-script
2+
3+
println!("hello, rust");

examples/time-main.ers

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env rust-script
2+
//! This is a regular crate doc comment, but it also contains a partial
3+
//! Cargo manifest. Note the use of a *fenced* code block, and the
4+
//! `cargo` "language".
5+
//!
6+
//! ```cargo
7+
//! [dependencies]
8+
//! time = "0.1.25"
9+
//! ```
10+
fn main() {
11+
println!("{}", time::now().rfc822z());
12+
}

examples/time-without-main.ers

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env rust-script
2+
//! This is a regular crate doc comment, but it also contains a partial
3+
//! Cargo manifest. Note the use of a *fenced* code block, and the
4+
//! `cargo` "language".
5+
//!
6+
//! ```cargo
7+
//! [dependencies]
8+
//! time = "0.1.25"
9+
//! ```
10+
11+
use time::now;
12+
13+
println!("{}", now().rfc822z());

0 commit comments

Comments
 (0)