Skip to content

Commit

Permalink
Update clap to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Oct 7, 2022
1 parent 7ed03fd commit f6d730e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 44 deletions.
69 changes: 29 additions & 40 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
version = "0.2.2"

[dependencies]
clap = {version = "3.2", features = ["derive", "env", "unicode", "cargo"]}
clap = {version = "4", features = ["derive", "env", "unicode", "cargo"]}
env_logger = "0.9"
log = "0.4"
serde = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod template;
mod wrapped_context;

use crate::template::Template;
use clap::{crate_name, crate_version, StructOpt};
use clap::{crate_name, crate_version, Parser};
use env_logger::Env;
use log::{debug, info, trace};
use opts::*;
Expand Down
4 changes: 2 additions & 2 deletions src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pub struct Opts {

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

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

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

0 comments on commit f6d730e

Please sign in to comment.