Skip to content

Commit

Permalink
Upgrade to clap 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalresistor committed Oct 2, 2022
1 parent 62c0445 commit 390efd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 45 deletions.
44 changes: 7 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "barnacle"
version = "0.1.1"
version = "0.2.0"
edition = "2021"
authors = ["Bert JW Regeer <[email protected]>"]
license = "ISC"
Expand All @@ -12,6 +12,6 @@ readme = "README.md"

[dependencies]
anyhow = "1.0"
clap = { version = "3.1", features = ["derive", "env"] }
clap = { version = "^4.0", features = ["derive", "env"] }
minijinja = { version = "^0.23", features = ["source", "json", "urlencode"] }
thiserror = "1.0"
12 changes: 6 additions & 6 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ use clap::Parser;
use std::path::PathBuf;

#[derive(Parser, Debug)]
#[clap(author, version, about)]
#[command(author, version, about)]
pub struct Cli {
/// Jinja2 template to render
#[clap(parse(from_os_str))]
#[arg()]
pub template: PathBuf,

/// The location to place the rendered file
#[clap(parse(from_os_str))]
#[arg()]
pub output: PathBuf,

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

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

0 comments on commit 390efd3

Please sign in to comment.