Skip to content

Commit f6d730e

Browse files
committed
Update clap to v4
1 parent 7ed03fd commit f6d730e

4 files changed

Lines changed: 33 additions & 44 deletions

File tree

Cargo.lock

Lines changed: 29 additions & 40 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ readme = "README.md"
88
version = "0.2.2"
99

1010
[dependencies]
11-
clap = {version = "3.2", features = ["derive", "env", "unicode", "cargo"]}
11+
clap = {version = "4", features = ["derive", "env", "unicode", "cargo"]}
1212
env_logger = "0.9"
1313
log = "0.4"
1414
serde = "1.0"

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod template;
33
mod wrapped_context;
44

55
use crate::template::Template;
6-
use clap::{crate_name, crate_version, StructOpt};
6+
use clap::{crate_name, crate_version, Parser};
77
use env_logger::Env;
88
use log::{debug, info, trace};
99
use opts::*;

src/opts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ pub struct Opts {
2121

2222
/// Location of the context data. This file can be of the following type:
2323
/// json | toml | yaml. If you prefer to pass the data as stdin, use `--stdin`
24-
#[clap(index = 1, required_unless_present_any = &["stdin", "env-only"], conflicts_with = "env-only")]
24+
#[clap(index = 1, required_unless_present_any = &["stdin", "env_only"], conflicts_with = "env_only")]
2525
pub context: Option<PathBuf>,
2626

2727
/// The context data can be passed using stdin
28-
#[clap(short, long, conflicts_with_all = &["context", "env-only"], required_unless_present_any = &["context", "env-only"])]
28+
#[clap(short, long, conflicts_with_all = &["context", "env_only"], required_unless_present_any = &["context", "env_only"])]
2929
pub stdin: bool,
3030

3131
/// If true, the current ENV will be appended to the data under the --env-key key

0 commit comments

Comments
 (0)