Skip to content

Commit c73a44b

Browse files
Merge pull request #80 from bertjwregeer/enhancement/upgrade-to-clap-4
Upgrade to clap 4.x
2 parents 62c0445 + 390efd3 commit c73a44b

File tree

3 files changed

+15
-45
lines changed

3 files changed

+15
-45
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "barnacle"
3-
version = "0.1.1"
3+
version = "0.2.0"
44
edition = "2021"
55
authors = ["Bert JW Regeer <xistence@0x58.com>"]
66
license = "ISC"
@@ -12,6 +12,6 @@ readme = "README.md"
1212

1313
[dependencies]
1414
anyhow = "1.0"
15-
clap = { version = "3.1", features = ["derive", "env"] }
15+
clap = { version = "^4.0", features = ["derive", "env"] }
1616
minijinja = { version = "^0.23", features = ["source", "json", "urlencode"] }
1717
thiserror = "1.0"

src/cli.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ use clap::Parser;
22
use std::path::PathBuf;
33

44
#[derive(Parser, Debug)]
5-
#[clap(author, version, about)]
5+
#[command(author, version, about)]
66
pub struct Cli {
77
/// Jinja2 template to render
8-
#[clap(parse(from_os_str))]
8+
#[arg()]
99
pub template: PathBuf,
1010

1111
/// The location to place the rendered file
12-
#[clap(parse(from_os_str))]
12+
#[arg()]
1313
pub output: PathBuf,
1414

1515
/// The command + arguments to execute once template is rendered
16-
#[clap(required(true))]
16+
#[arg(required(true))]
1717
pub command: Vec<String>,
1818

1919
/// Turn debugging information on
20-
#[clap(short, long, parse(from_occurrences))]
21-
pub verbose: usize,
20+
#[arg(short, long, action = clap::ArgAction::Count)]
21+
pub verbose: u8,
2222
}

0 commit comments

Comments
 (0)