Skip to content

Commit

Permalink
Update clap to newest version (#77)
Browse files Browse the repository at this point in the history
* update clap to newest version

* fix bin target
  • Loading branch information
unknowntrojan committed Oct 27, 2023
1 parent ce5bfde commit 08e35ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dotenv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ name = "dotenvy"
required-features = ["cli"]

[dependencies]
clap = { version = "3.2", optional = true }
clap = { version = "4.3.11", optional = true }

[dev-dependencies]
tempfile = "3.3.0"
Expand Down
7 changes: 3 additions & 4 deletions dotenv/src/bin/dotenvy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ fn main() {
Arg::new("FILE")
.short('f')
.long("file")
.takes_value(true)
.help("Use a specific .env file (defaults to .env)"),
)
.get_matches();

match matches.value_of("FILE") {
match matches.get_one::<String>("FILE") {
None => dotenvy::dotenv(),
Some(file) => dotenvy::from_filename(file),
}
Expand All @@ -47,8 +46,8 @@ fn main() {
let mut command = match matches.subcommand() {
Some((name, matches)) => {
let args = matches
.values_of("")
.map(|v| v.collect())
.get_many("")
.map(|v| v.copied().collect())
.unwrap_or(Vec::new());

make_command(name, args)
Expand Down

0 comments on commit 08e35ee

Please sign in to comment.