Skip to content

Commit

Permalink
Switch arg parsing to clap v4 with derive
Browse files Browse the repository at this point in the history
  • Loading branch information
tranzystorekk committed Mar 2, 2023
1 parent ea56a7c commit 2d01c90
Show file tree
Hide file tree
Showing 26 changed files with 984 additions and 1,255 deletions.
207 changes: 165 additions & 42 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ name = "lsd"
path = "src/main.rs"

[build-dependencies]
clap = "3.2.17"
clap_complete = "3.2.4"
clap = { version = "4.1", features = ["derive"] }
clap_complete = "4.1"
version_check = "0.9.*"

[dependencies]
Expand Down Expand Up @@ -48,8 +48,8 @@ xattr = "0.2.*"
windows = { version = "0.43.0", features = ["Win32_Foundation", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_Memory"] }

[dependencies.clap]
features = ["suggestions", "color", "wrap_help"]
version = "3.2.17"
features = ["derive", "wrap_help"]
version = "4.1"

[dev-dependencies]
assert_cmd = "1"
Expand Down
6 changes: 2 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// notice may not be copied, modified, or distributed except
// according to those terms.

extern crate clap;
extern crate version_check;

use clap::CommandFactory;
use clap_complete::generate_to;
use clap_complete::shells::*;
use std::fs;
Expand All @@ -29,7 +27,7 @@ fn main() {

fs::create_dir_all(&outdir).unwrap();

let mut app = build();
let mut app = Cli::command();
let bin_name = "lsd";
generate_to(Bash, &mut app, bin_name, &outdir).expect("Failed to generate Bash completions");
generate_to(Fish, &mut app, bin_name, &outdir).expect("Failed to generate Fish completions");
Expand Down
Loading

0 comments on commit 2d01c90

Please sign in to comment.