update clap dependency from 2 to 3

This commit is contained in:
Astro 2022-01-14 19:37:38 +01:00
parent c8f3a3e48b
commit d99f70d341
3 changed files with 73 additions and 57 deletions

96
Cargo.lock generated
View File

@ -2,15 +2,6 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "ansi_term"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
"winapi",
]
[[package]]
name = "atty"
version = "0.2.14"
@ -45,17 +36,17 @@ dependencies = [
[[package]]
name = "clap"
version = "2.34.0"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
checksum = "12e8611f9ae4e068fa3e56931fded356ff745e70987ff76924a6e0ab1c8ef2e3"
dependencies = [
"ansi_term",
"atty",
"bitflags",
"indexmap",
"os_str_bytes",
"strsim",
"termcolor",
"textwrap",
"unicode-width",
"vec_map",
]
[[package]]
@ -66,7 +57,7 @@ checksum = "328b822bdcba4d4e402be8d9adb6eebf269f969f8eadef977a553ff3c4fbcb58"
[[package]]
name = "deadnix"
version = "0.1.2"
version = "0.1.3"
dependencies = [
"clap",
"rnix",
@ -80,6 +71,12 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
[[package]]
name = "hashbrown"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]]
name = "hermit-abi"
version = "0.1.19"
@ -90,10 +87,26 @@ dependencies = [
]
[[package]]
name = "libc"
version = "0.2.109"
name = "indexmap"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01"
checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
dependencies = [
"autocfg",
"hashbrown 0.11.2",
]
[[package]]
name = "libc"
version = "0.2.112"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
[[package]]
name = "memchr"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memoffset"
@ -113,6 +126,15 @@ dependencies = [
"autocfg",
]
[[package]]
name = "os_str_bytes"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
dependencies = [
"memchr",
]
[[package]]
name = "rnix"
version = "0.10.1"
@ -131,7 +153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1b36e449f3702f3b0c821411db1cbdf30fb451726a9456dce5dabcd44420043"
dependencies = [
"countme",
"hashbrown",
"hashbrown 0.9.1",
"memoffset",
"rustc-hash",
"text-size",
@ -154,9 +176,9 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.131"
version = "1.0.133"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1"
checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
[[package]]
name = "smol_str"
@ -169,9 +191,18 @@ dependencies = [
[[package]]
name = "strsim"
version = "0.8.0"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "termcolor"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
dependencies = [
"winapi-util",
]
[[package]]
name = "text-size"
@ -181,24 +212,9 @@ checksum = "288cb548dbe72b652243ea797201f3d481a0609a967980fcc5b2315ea811560a"
[[package]]
name = "textwrap"
version = "0.11.0"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
dependencies = [
"unicode-width",
]
[[package]]
name = "unicode-width"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
[[package]]
name = "walkdir"

View File

@ -12,5 +12,5 @@ documentation = "https://docs.rs/deadnix"
[dependencies]
rowan = "0.12"
rnix = "0.10"
clap = "2"
clap = "3"
walkdir = "2"

View File

@ -15,50 +15,50 @@ fn main() {
.author("Astro <astro@spaceboyz.net>")
.about("Find dead code in .nix files")
.arg(
clap::Arg::with_name("NO_LAMBDA_ARG")
.short("l")
clap::Arg::new("NO_LAMBDA_ARG")
.short('l')
.long("no-lambda-arg")
.help("Don't check lambda parameter arguments"),
)
.arg(
clap::Arg::with_name("NO_LAMBDA_PATTERN_NAMES")
.short("L")
clap::Arg::new("NO_LAMBDA_PATTERN_NAMES")
.short('L')
.long("no-lambda-pattern-names")
.help("Don't check lambda attrset pattern names (don't break nixpkgs callPackage)"),
)
.arg(
clap::Arg::with_name("NO_UNDERSCORE")
.short("_")
clap::Arg::new("NO_UNDERSCORE")
.short('_')
.long("no-underscore")
.help("Don't check any bindings that start with a _"),
)
.arg(
clap::Arg::with_name("QUIET")
.short("q")
clap::Arg::new("QUIET")
.short('q')
.long("quiet")
.help("Don't print dead code report"),
)
.arg(
clap::Arg::with_name("EDIT")
.short("e")
clap::Arg::new("EDIT")
.short('e')
.long("edit")
.help("Remove unused code and write to source file"),
)
.arg(
clap::Arg::with_name("HIDDEN")
.short("h")
clap::Arg::new("HIDDEN")
.short('h')
.long("hidden")
.help("Recurse into hidden subdirectories and process hidden .*.nix files"),
)
.arg(
clap::Arg::with_name("FAIL_ON_REPORTS")
.short("f")
clap::Arg::new("FAIL_ON_REPORTS")
.short('f')
.long("fail")
.help("Exit with 1 if unused code has been found"),
)
.arg(
clap::Arg::with_name("FILE_PATHS")
.multiple(true)
clap::Arg::new("FILE_PATHS")
.multiple_values(true)
.help(".nix files, or directories with .nix files inside"),
)
.get_matches();