Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/.cargo-ok +1 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/.cargo_vcs_info.json +6 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/.gitignore +2 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/Cargo.lock +424 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/Cargo.toml +132 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/Cargo.toml.orig +40 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/LICENSE-APACHE +176 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/LICENSE-MIT +23 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/README.md +179 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/build.rs +207 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/rust-toolchain.toml +2 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/.cargo-ok +1 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/.cargo_vcs_info.json +6 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/Cargo.lock +917 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/Cargo.toml +635 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/Cargo.toml.orig +538 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/LICENSE-APACHE +202 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/LICENSE-MIT +19 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/README.md +49 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/README.md +16 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example-derive.md +38 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example-derive.rs +31 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example.md +38 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example.rs +29 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/demo.md +17 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/demo.rs +22 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/augment_args.rs +27 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/augment_subcommands.rs +21 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/flatten_hand_args.rs +91 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/hand_subcommand.rs +80 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/interop_tests.md +248 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional-derive.md +60 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional-derive.rs +25 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional.md +60 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional.rs +32 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/find.md +79 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/find.rs +126 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git-derive.md +172 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git-derive.rs +165 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git.md +170 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git.rs +138 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-busybox.md +39 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-busybox.rs +47 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-hostname.md +10 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-hostname.rs +17 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/pacman.md +83 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/pacman.rs +110 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/repl-derive.rs +67 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/repl.rs +92 -0
- .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/tutorial_builder/01_quick.md +35 -0
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/.cargo-ok
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"v":1}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/.cargo_vcs_info.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"git": {
|
| 3 |
+
"sha1": "80bfe291b16071c70f141e90e67e7032d966826b"
|
| 4 |
+
},
|
| 5 |
+
"path_in_vcs": ""
|
| 6 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/target/
|
| 2 |
+
/Cargo.lock
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/Cargo.lock
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is automatically @generated by Cargo.
|
| 2 |
+
# It is not intended for manual editing.
|
| 3 |
+
version = 3
|
| 4 |
+
|
| 5 |
+
[[package]]
|
| 6 |
+
name = "addr2line"
|
| 7 |
+
version = "0.25.1"
|
| 8 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 9 |
+
checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
|
| 10 |
+
dependencies = [
|
| 11 |
+
"gimli",
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
[[package]]
|
| 15 |
+
name = "adler2"
|
| 16 |
+
version = "2.0.1"
|
| 17 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 18 |
+
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
| 19 |
+
|
| 20 |
+
[[package]]
|
| 21 |
+
name = "anyhow"
|
| 22 |
+
version = "1.0.101"
|
| 23 |
+
dependencies = [
|
| 24 |
+
"backtrace",
|
| 25 |
+
"futures",
|
| 26 |
+
"rustversion",
|
| 27 |
+
"syn",
|
| 28 |
+
"thiserror",
|
| 29 |
+
"trybuild",
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
[[package]]
|
| 33 |
+
name = "backtrace"
|
| 34 |
+
version = "0.3.76"
|
| 35 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 36 |
+
checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6"
|
| 37 |
+
dependencies = [
|
| 38 |
+
"addr2line",
|
| 39 |
+
"cfg-if",
|
| 40 |
+
"libc",
|
| 41 |
+
"miniz_oxide",
|
| 42 |
+
"object",
|
| 43 |
+
"rustc-demangle",
|
| 44 |
+
"windows-link",
|
| 45 |
+
]
|
| 46 |
+
|
| 47 |
+
[[package]]
|
| 48 |
+
name = "cfg-if"
|
| 49 |
+
version = "1.0.4"
|
| 50 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 51 |
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
| 52 |
+
|
| 53 |
+
[[package]]
|
| 54 |
+
name = "dissimilar"
|
| 55 |
+
version = "1.0.10"
|
| 56 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 57 |
+
checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921"
|
| 58 |
+
|
| 59 |
+
[[package]]
|
| 60 |
+
name = "equivalent"
|
| 61 |
+
version = "1.0.2"
|
| 62 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 63 |
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
| 64 |
+
|
| 65 |
+
[[package]]
|
| 66 |
+
name = "futures"
|
| 67 |
+
version = "0.3.31"
|
| 68 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 69 |
+
checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
|
| 70 |
+
dependencies = [
|
| 71 |
+
"futures-channel",
|
| 72 |
+
"futures-core",
|
| 73 |
+
"futures-io",
|
| 74 |
+
"futures-sink",
|
| 75 |
+
"futures-task",
|
| 76 |
+
"futures-util",
|
| 77 |
+
]
|
| 78 |
+
|
| 79 |
+
[[package]]
|
| 80 |
+
name = "futures-channel"
|
| 81 |
+
version = "0.3.31"
|
| 82 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 83 |
+
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
|
| 84 |
+
dependencies = [
|
| 85 |
+
"futures-core",
|
| 86 |
+
"futures-sink",
|
| 87 |
+
]
|
| 88 |
+
|
| 89 |
+
[[package]]
|
| 90 |
+
name = "futures-core"
|
| 91 |
+
version = "0.3.31"
|
| 92 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 93 |
+
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
| 94 |
+
|
| 95 |
+
[[package]]
|
| 96 |
+
name = "futures-io"
|
| 97 |
+
version = "0.3.31"
|
| 98 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 99 |
+
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
|
| 100 |
+
|
| 101 |
+
[[package]]
|
| 102 |
+
name = "futures-sink"
|
| 103 |
+
version = "0.3.31"
|
| 104 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 105 |
+
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
|
| 106 |
+
|
| 107 |
+
[[package]]
|
| 108 |
+
name = "futures-task"
|
| 109 |
+
version = "0.3.31"
|
| 110 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 111 |
+
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
|
| 112 |
+
|
| 113 |
+
[[package]]
|
| 114 |
+
name = "futures-util"
|
| 115 |
+
version = "0.3.31"
|
| 116 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 117 |
+
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
|
| 118 |
+
dependencies = [
|
| 119 |
+
"futures-core",
|
| 120 |
+
"futures-sink",
|
| 121 |
+
"futures-task",
|
| 122 |
+
"pin-project-lite",
|
| 123 |
+
"pin-utils",
|
| 124 |
+
]
|
| 125 |
+
|
| 126 |
+
[[package]]
|
| 127 |
+
name = "gimli"
|
| 128 |
+
version = "0.32.3"
|
| 129 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 130 |
+
checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
|
| 131 |
+
|
| 132 |
+
[[package]]
|
| 133 |
+
name = "glob"
|
| 134 |
+
version = "0.3.3"
|
| 135 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 136 |
+
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
| 137 |
+
|
| 138 |
+
[[package]]
|
| 139 |
+
name = "hashbrown"
|
| 140 |
+
version = "0.16.1"
|
| 141 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 142 |
+
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
| 143 |
+
|
| 144 |
+
[[package]]
|
| 145 |
+
name = "indexmap"
|
| 146 |
+
version = "2.13.0"
|
| 147 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 148 |
+
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
|
| 149 |
+
dependencies = [
|
| 150 |
+
"equivalent",
|
| 151 |
+
"hashbrown",
|
| 152 |
+
]
|
| 153 |
+
|
| 154 |
+
[[package]]
|
| 155 |
+
name = "itoa"
|
| 156 |
+
version = "1.0.17"
|
| 157 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 158 |
+
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
| 159 |
+
|
| 160 |
+
[[package]]
|
| 161 |
+
name = "libc"
|
| 162 |
+
version = "0.2.180"
|
| 163 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 164 |
+
checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
|
| 165 |
+
|
| 166 |
+
[[package]]
|
| 167 |
+
name = "memchr"
|
| 168 |
+
version = "2.7.6"
|
| 169 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 170 |
+
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
|
| 171 |
+
|
| 172 |
+
[[package]]
|
| 173 |
+
name = "miniz_oxide"
|
| 174 |
+
version = "0.8.9"
|
| 175 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 176 |
+
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
|
| 177 |
+
dependencies = [
|
| 178 |
+
"adler2",
|
| 179 |
+
]
|
| 180 |
+
|
| 181 |
+
[[package]]
|
| 182 |
+
name = "object"
|
| 183 |
+
version = "0.37.3"
|
| 184 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 185 |
+
checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
|
| 186 |
+
dependencies = [
|
| 187 |
+
"memchr",
|
| 188 |
+
]
|
| 189 |
+
|
| 190 |
+
[[package]]
|
| 191 |
+
name = "pin-project-lite"
|
| 192 |
+
version = "0.2.16"
|
| 193 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 194 |
+
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
|
| 195 |
+
|
| 196 |
+
[[package]]
|
| 197 |
+
name = "pin-utils"
|
| 198 |
+
version = "0.1.0"
|
| 199 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 200 |
+
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
| 201 |
+
|
| 202 |
+
[[package]]
|
| 203 |
+
name = "proc-macro2"
|
| 204 |
+
version = "1.0.106"
|
| 205 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 206 |
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
| 207 |
+
dependencies = [
|
| 208 |
+
"unicode-ident",
|
| 209 |
+
]
|
| 210 |
+
|
| 211 |
+
[[package]]
|
| 212 |
+
name = "quote"
|
| 213 |
+
version = "1.0.44"
|
| 214 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 215 |
+
checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
|
| 216 |
+
dependencies = [
|
| 217 |
+
"proc-macro2",
|
| 218 |
+
]
|
| 219 |
+
|
| 220 |
+
[[package]]
|
| 221 |
+
name = "rustc-demangle"
|
| 222 |
+
version = "0.1.27"
|
| 223 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 224 |
+
checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
|
| 225 |
+
|
| 226 |
+
[[package]]
|
| 227 |
+
name = "rustversion"
|
| 228 |
+
version = "1.0.22"
|
| 229 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 230 |
+
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
| 231 |
+
|
| 232 |
+
[[package]]
|
| 233 |
+
name = "serde"
|
| 234 |
+
version = "1.0.228"
|
| 235 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 236 |
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
| 237 |
+
dependencies = [
|
| 238 |
+
"serde_core",
|
| 239 |
+
]
|
| 240 |
+
|
| 241 |
+
[[package]]
|
| 242 |
+
name = "serde_core"
|
| 243 |
+
version = "1.0.228"
|
| 244 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 245 |
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
| 246 |
+
dependencies = [
|
| 247 |
+
"serde_derive",
|
| 248 |
+
]
|
| 249 |
+
|
| 250 |
+
[[package]]
|
| 251 |
+
name = "serde_derive"
|
| 252 |
+
version = "1.0.228"
|
| 253 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 254 |
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
| 255 |
+
dependencies = [
|
| 256 |
+
"proc-macro2",
|
| 257 |
+
"quote",
|
| 258 |
+
"syn",
|
| 259 |
+
]
|
| 260 |
+
|
| 261 |
+
[[package]]
|
| 262 |
+
name = "serde_json"
|
| 263 |
+
version = "1.0.149"
|
| 264 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 265 |
+
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
|
| 266 |
+
dependencies = [
|
| 267 |
+
"itoa",
|
| 268 |
+
"memchr",
|
| 269 |
+
"serde",
|
| 270 |
+
"serde_core",
|
| 271 |
+
"zmij",
|
| 272 |
+
]
|
| 273 |
+
|
| 274 |
+
[[package]]
|
| 275 |
+
name = "serde_spanned"
|
| 276 |
+
version = "1.0.4"
|
| 277 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 278 |
+
checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776"
|
| 279 |
+
dependencies = [
|
| 280 |
+
"serde_core",
|
| 281 |
+
]
|
| 282 |
+
|
| 283 |
+
[[package]]
|
| 284 |
+
name = "syn"
|
| 285 |
+
version = "2.0.114"
|
| 286 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 287 |
+
checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
|
| 288 |
+
dependencies = [
|
| 289 |
+
"proc-macro2",
|
| 290 |
+
"quote",
|
| 291 |
+
"unicode-ident",
|
| 292 |
+
]
|
| 293 |
+
|
| 294 |
+
[[package]]
|
| 295 |
+
name = "target-triple"
|
| 296 |
+
version = "1.0.0"
|
| 297 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 298 |
+
checksum = "591ef38edfb78ca4771ee32cf494cb8771944bee237a9b91fc9c1424ac4b777b"
|
| 299 |
+
|
| 300 |
+
[[package]]
|
| 301 |
+
name = "termcolor"
|
| 302 |
+
version = "1.4.1"
|
| 303 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 304 |
+
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
| 305 |
+
dependencies = [
|
| 306 |
+
"winapi-util",
|
| 307 |
+
]
|
| 308 |
+
|
| 309 |
+
[[package]]
|
| 310 |
+
name = "thiserror"
|
| 311 |
+
version = "2.0.18"
|
| 312 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 313 |
+
checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
|
| 314 |
+
dependencies = [
|
| 315 |
+
"thiserror-impl",
|
| 316 |
+
]
|
| 317 |
+
|
| 318 |
+
[[package]]
|
| 319 |
+
name = "thiserror-impl"
|
| 320 |
+
version = "2.0.18"
|
| 321 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 322 |
+
checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
|
| 323 |
+
dependencies = [
|
| 324 |
+
"proc-macro2",
|
| 325 |
+
"quote",
|
| 326 |
+
"syn",
|
| 327 |
+
]
|
| 328 |
+
|
| 329 |
+
[[package]]
|
| 330 |
+
name = "toml"
|
| 331 |
+
version = "0.9.11+spec-1.1.0"
|
| 332 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 333 |
+
checksum = "f3afc9a848309fe1aaffaed6e1546a7a14de1f935dc9d89d32afd9a44bab7c46"
|
| 334 |
+
dependencies = [
|
| 335 |
+
"indexmap",
|
| 336 |
+
"serde_core",
|
| 337 |
+
"serde_spanned",
|
| 338 |
+
"toml_datetime",
|
| 339 |
+
"toml_parser",
|
| 340 |
+
"toml_writer",
|
| 341 |
+
"winnow",
|
| 342 |
+
]
|
| 343 |
+
|
| 344 |
+
[[package]]
|
| 345 |
+
name = "toml_datetime"
|
| 346 |
+
version = "0.7.5+spec-1.1.0"
|
| 347 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 348 |
+
checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
|
| 349 |
+
dependencies = [
|
| 350 |
+
"serde_core",
|
| 351 |
+
]
|
| 352 |
+
|
| 353 |
+
[[package]]
|
| 354 |
+
name = "toml_parser"
|
| 355 |
+
version = "1.0.6+spec-1.1.0"
|
| 356 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 357 |
+
checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
|
| 358 |
+
dependencies = [
|
| 359 |
+
"winnow",
|
| 360 |
+
]
|
| 361 |
+
|
| 362 |
+
[[package]]
|
| 363 |
+
name = "toml_writer"
|
| 364 |
+
version = "1.0.6+spec-1.1.0"
|
| 365 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 366 |
+
checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
|
| 367 |
+
|
| 368 |
+
[[package]]
|
| 369 |
+
name = "trybuild"
|
| 370 |
+
version = "1.0.115"
|
| 371 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 372 |
+
checksum = "5f614c21bd3a61bad9501d75cbb7686f00386c806d7f456778432c25cf86948a"
|
| 373 |
+
dependencies = [
|
| 374 |
+
"dissimilar",
|
| 375 |
+
"glob",
|
| 376 |
+
"serde",
|
| 377 |
+
"serde_derive",
|
| 378 |
+
"serde_json",
|
| 379 |
+
"target-triple",
|
| 380 |
+
"termcolor",
|
| 381 |
+
"toml",
|
| 382 |
+
]
|
| 383 |
+
|
| 384 |
+
[[package]]
|
| 385 |
+
name = "unicode-ident"
|
| 386 |
+
version = "1.0.22"
|
| 387 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 388 |
+
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
|
| 389 |
+
|
| 390 |
+
[[package]]
|
| 391 |
+
name = "winapi-util"
|
| 392 |
+
version = "0.1.11"
|
| 393 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 394 |
+
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
| 395 |
+
dependencies = [
|
| 396 |
+
"windows-sys",
|
| 397 |
+
]
|
| 398 |
+
|
| 399 |
+
[[package]]
|
| 400 |
+
name = "windows-link"
|
| 401 |
+
version = "0.2.1"
|
| 402 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 403 |
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
| 404 |
+
|
| 405 |
+
[[package]]
|
| 406 |
+
name = "windows-sys"
|
| 407 |
+
version = "0.61.2"
|
| 408 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 409 |
+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
| 410 |
+
dependencies = [
|
| 411 |
+
"windows-link",
|
| 412 |
+
]
|
| 413 |
+
|
| 414 |
+
[[package]]
|
| 415 |
+
name = "winnow"
|
| 416 |
+
version = "0.7.14"
|
| 417 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 418 |
+
checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829"
|
| 419 |
+
|
| 420 |
+
[[package]]
|
| 421 |
+
name = "zmij"
|
| 422 |
+
version = "1.0.19"
|
| 423 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 424 |
+
checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445"
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/Cargo.toml
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
| 2 |
+
#
|
| 3 |
+
# When uploading crates to the registry Cargo will automatically
|
| 4 |
+
# "normalize" Cargo.toml files for maximal compatibility
|
| 5 |
+
# with all versions of Cargo and also rewrite `path` dependencies
|
| 6 |
+
# to registry (e.g., crates.io) dependencies.
|
| 7 |
+
#
|
| 8 |
+
# If you are reading this file be aware that the original Cargo.toml
|
| 9 |
+
# will likely look very different (and much more reasonable).
|
| 10 |
+
# See Cargo.toml.orig for the original contents.
|
| 11 |
+
|
| 12 |
+
[package]
|
| 13 |
+
edition = "2021"
|
| 14 |
+
rust-version = "1.68"
|
| 15 |
+
name = "anyhow"
|
| 16 |
+
version = "1.0.101"
|
| 17 |
+
authors = ["David Tolnay <dtolnay@gmail.com>"]
|
| 18 |
+
build = "build.rs"
|
| 19 |
+
autolib = false
|
| 20 |
+
autobins = false
|
| 21 |
+
autoexamples = false
|
| 22 |
+
autotests = false
|
| 23 |
+
autobenches = false
|
| 24 |
+
description = "Flexible concrete Error type built on std::error::Error"
|
| 25 |
+
documentation = "https://docs.rs/anyhow"
|
| 26 |
+
readme = "README.md"
|
| 27 |
+
keywords = [
|
| 28 |
+
"error",
|
| 29 |
+
"error-handling",
|
| 30 |
+
]
|
| 31 |
+
categories = [
|
| 32 |
+
"rust-patterns",
|
| 33 |
+
"no-std",
|
| 34 |
+
]
|
| 35 |
+
license = "MIT OR Apache-2.0"
|
| 36 |
+
repository = "https://github.com/dtolnay/anyhow"
|
| 37 |
+
|
| 38 |
+
[package.metadata.docs.rs]
|
| 39 |
+
targets = ["x86_64-unknown-linux-gnu"]
|
| 40 |
+
rustdoc-args = [
|
| 41 |
+
"--generate-link-to-definition",
|
| 42 |
+
"--generate-macro-expansion",
|
| 43 |
+
"--extern-html-root-url=core=https://doc.rust-lang.org",
|
| 44 |
+
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
|
| 45 |
+
"--extern-html-root-url=std=https://doc.rust-lang.org",
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
[features]
|
| 49 |
+
default = ["std"]
|
| 50 |
+
std = []
|
| 51 |
+
|
| 52 |
+
[lib]
|
| 53 |
+
name = "anyhow"
|
| 54 |
+
path = "src/lib.rs"
|
| 55 |
+
|
| 56 |
+
[[test]]
|
| 57 |
+
name = "compiletest"
|
| 58 |
+
path = "tests/compiletest.rs"
|
| 59 |
+
|
| 60 |
+
[[test]]
|
| 61 |
+
name = "test_autotrait"
|
| 62 |
+
path = "tests/test_autotrait.rs"
|
| 63 |
+
|
| 64 |
+
[[test]]
|
| 65 |
+
name = "test_backtrace"
|
| 66 |
+
path = "tests/test_backtrace.rs"
|
| 67 |
+
|
| 68 |
+
[[test]]
|
| 69 |
+
name = "test_boxed"
|
| 70 |
+
path = "tests/test_boxed.rs"
|
| 71 |
+
|
| 72 |
+
[[test]]
|
| 73 |
+
name = "test_chain"
|
| 74 |
+
path = "tests/test_chain.rs"
|
| 75 |
+
|
| 76 |
+
[[test]]
|
| 77 |
+
name = "test_context"
|
| 78 |
+
path = "tests/test_context.rs"
|
| 79 |
+
|
| 80 |
+
[[test]]
|
| 81 |
+
name = "test_convert"
|
| 82 |
+
path = "tests/test_convert.rs"
|
| 83 |
+
|
| 84 |
+
[[test]]
|
| 85 |
+
name = "test_downcast"
|
| 86 |
+
path = "tests/test_downcast.rs"
|
| 87 |
+
|
| 88 |
+
[[test]]
|
| 89 |
+
name = "test_ensure"
|
| 90 |
+
path = "tests/test_ensure.rs"
|
| 91 |
+
|
| 92 |
+
[[test]]
|
| 93 |
+
name = "test_ffi"
|
| 94 |
+
path = "tests/test_ffi.rs"
|
| 95 |
+
|
| 96 |
+
[[test]]
|
| 97 |
+
name = "test_fmt"
|
| 98 |
+
path = "tests/test_fmt.rs"
|
| 99 |
+
|
| 100 |
+
[[test]]
|
| 101 |
+
name = "test_macros"
|
| 102 |
+
path = "tests/test_macros.rs"
|
| 103 |
+
|
| 104 |
+
[[test]]
|
| 105 |
+
name = "test_repr"
|
| 106 |
+
path = "tests/test_repr.rs"
|
| 107 |
+
|
| 108 |
+
[[test]]
|
| 109 |
+
name = "test_source"
|
| 110 |
+
path = "tests/test_source.rs"
|
| 111 |
+
|
| 112 |
+
[dependencies.backtrace]
|
| 113 |
+
version = "0.3.51"
|
| 114 |
+
optional = true
|
| 115 |
+
|
| 116 |
+
[dev-dependencies.futures]
|
| 117 |
+
version = "0.3"
|
| 118 |
+
default-features = false
|
| 119 |
+
|
| 120 |
+
[dev-dependencies.rustversion]
|
| 121 |
+
version = "1.0.6"
|
| 122 |
+
|
| 123 |
+
[dev-dependencies.syn]
|
| 124 |
+
version = "2.0"
|
| 125 |
+
features = ["full"]
|
| 126 |
+
|
| 127 |
+
[dev-dependencies.thiserror]
|
| 128 |
+
version = "2"
|
| 129 |
+
|
| 130 |
+
[dev-dependencies.trybuild]
|
| 131 |
+
version = "1.0.108"
|
| 132 |
+
features = ["diff"]
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/Cargo.toml.orig
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[package]
|
| 2 |
+
name = "anyhow"
|
| 3 |
+
version = "1.0.101"
|
| 4 |
+
authors = ["David Tolnay <dtolnay@gmail.com>"]
|
| 5 |
+
categories = ["rust-patterns", "no-std"]
|
| 6 |
+
description = "Flexible concrete Error type built on std::error::Error"
|
| 7 |
+
documentation = "https://docs.rs/anyhow"
|
| 8 |
+
edition = "2021"
|
| 9 |
+
keywords = ["error", "error-handling"]
|
| 10 |
+
license = "MIT OR Apache-2.0"
|
| 11 |
+
repository = "https://github.com/dtolnay/anyhow"
|
| 12 |
+
rust-version = "1.68"
|
| 13 |
+
|
| 14 |
+
[features]
|
| 15 |
+
default = ["std"]
|
| 16 |
+
std = []
|
| 17 |
+
|
| 18 |
+
[dependencies]
|
| 19 |
+
# On compilers older than 1.65, features=["backtrace"] may be used to enable
|
| 20 |
+
# backtraces via the `backtrace` crate. This feature has no effect on 1.65+
|
| 21 |
+
# besides bringing in an unused dependency, as `std::backtrace` is always
|
| 22 |
+
# preferred.
|
| 23 |
+
backtrace = { version = "0.3.51", optional = true }
|
| 24 |
+
|
| 25 |
+
[dev-dependencies]
|
| 26 |
+
futures = { version = "0.3", default-features = false }
|
| 27 |
+
rustversion = "1.0.6"
|
| 28 |
+
syn = { version = "2.0", features = ["full"] }
|
| 29 |
+
thiserror = "2"
|
| 30 |
+
trybuild = { version = "1.0.108", features = ["diff"] }
|
| 31 |
+
|
| 32 |
+
[package.metadata.docs.rs]
|
| 33 |
+
targets = ["x86_64-unknown-linux-gnu"]
|
| 34 |
+
rustdoc-args = [
|
| 35 |
+
"--generate-link-to-definition",
|
| 36 |
+
"--generate-macro-expansion",
|
| 37 |
+
"--extern-html-root-url=core=https://doc.rust-lang.org",
|
| 38 |
+
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
|
| 39 |
+
"--extern-html-root-url=std=https://doc.rust-lang.org",
|
| 40 |
+
]
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/LICENSE-MIT
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Permission is hereby granted, free of charge, to any
|
| 2 |
+
person obtaining a copy of this software and associated
|
| 3 |
+
documentation files (the "Software"), to deal in the
|
| 4 |
+
Software without restriction, including without
|
| 5 |
+
limitation the rights to use, copy, modify, merge,
|
| 6 |
+
publish, distribute, sublicense, and/or sell copies of
|
| 7 |
+
the Software, and to permit persons to whom the Software
|
| 8 |
+
is furnished to do so, subject to the following
|
| 9 |
+
conditions:
|
| 10 |
+
|
| 11 |
+
The above copyright notice and this permission notice
|
| 12 |
+
shall be included in all copies or substantial portions
|
| 13 |
+
of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
| 16 |
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
| 17 |
+
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
| 18 |
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
| 19 |
+
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| 20 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
| 22 |
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
| 23 |
+
DEALINGS IN THE SOFTWARE.
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Anyhow ¯\\\_(°ペ)\_/¯
|
| 2 |
+
==========================
|
| 3 |
+
|
| 4 |
+
[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/anyhow-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/anyhow)
|
| 5 |
+
[<img alt="crates.io" src="https://img.shields.io/crates/v/anyhow.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/anyhow)
|
| 6 |
+
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-anyhow-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/anyhow)
|
| 7 |
+
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/anyhow/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/anyhow/actions?query=branch%3Amaster)
|
| 8 |
+
|
| 9 |
+
This library provides [`anyhow::Error`][Error], a trait object based error type
|
| 10 |
+
for easy idiomatic error handling in Rust applications.
|
| 11 |
+
|
| 12 |
+
[Error]: https://docs.rs/anyhow/1.0/anyhow/struct.Error.html
|
| 13 |
+
|
| 14 |
+
```toml
|
| 15 |
+
[dependencies]
|
| 16 |
+
anyhow = "1.0"
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
<br>
|
| 20 |
+
|
| 21 |
+
## Details
|
| 22 |
+
|
| 23 |
+
- Use `Result<T, anyhow::Error>`, or equivalently `anyhow::Result<T>`, as the
|
| 24 |
+
return type of any fallible function.
|
| 25 |
+
|
| 26 |
+
Within the function, use `?` to easily propagate any error that implements the
|
| 27 |
+
[`std::error::Error`] trait.
|
| 28 |
+
|
| 29 |
+
```rust
|
| 30 |
+
use anyhow::Result;
|
| 31 |
+
|
| 32 |
+
fn get_cluster_info() -> Result<ClusterMap> {
|
| 33 |
+
let config = std::fs::read_to_string("cluster.json")?;
|
| 34 |
+
let map: ClusterMap = serde_json::from_str(&config)?;
|
| 35 |
+
Ok(map)
|
| 36 |
+
}
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
[`std::error::Error`]: https://doc.rust-lang.org/std/error/trait.Error.html
|
| 40 |
+
|
| 41 |
+
- Attach context to help the person troubleshooting the error understand where
|
| 42 |
+
things went wrong. A low-level error like "No such file or directory" can be
|
| 43 |
+
annoying to debug without more context about what higher level step the
|
| 44 |
+
application was in the middle of.
|
| 45 |
+
|
| 46 |
+
```rust
|
| 47 |
+
use anyhow::{Context, Result};
|
| 48 |
+
|
| 49 |
+
fn main() -> Result<()> {
|
| 50 |
+
...
|
| 51 |
+
it.detach().context("Failed to detach the important thing")?;
|
| 52 |
+
|
| 53 |
+
let content = std::fs::read(path)
|
| 54 |
+
.with_context(|| format!("Failed to read instrs from {}", path))?;
|
| 55 |
+
...
|
| 56 |
+
}
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
```console
|
| 60 |
+
Error: Failed to read instrs from ./path/to/instrs.json
|
| 61 |
+
|
| 62 |
+
Caused by:
|
| 63 |
+
No such file or directory (os error 2)
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
- Downcasting is supported and can be by value, by shared reference, or by
|
| 67 |
+
mutable reference as needed.
|
| 68 |
+
|
| 69 |
+
```rust
|
| 70 |
+
// If the error was caused by redaction, then return a
|
| 71 |
+
// tombstone instead of the content.
|
| 72 |
+
match root_cause.downcast_ref::<DataStoreError>() {
|
| 73 |
+
Some(DataStoreError::Censored(_)) => Ok(Poll::Ready(REDACTED_CONTENT)),
|
| 74 |
+
None => Err(error),
|
| 75 |
+
}
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
- If using Rust ≥ 1.65, a backtrace is captured and printed with the error if
|
| 79 |
+
the underlying error type does not already provide its own. In order to see
|
| 80 |
+
backtraces, they must be enabled through the environment variables described
|
| 81 |
+
in [`std::backtrace`]:
|
| 82 |
+
|
| 83 |
+
- If you want panics and errors to both have backtraces, set
|
| 84 |
+
`RUST_BACKTRACE=1`;
|
| 85 |
+
- If you want only errors to have backtraces, set `RUST_LIB_BACKTRACE=1`;
|
| 86 |
+
- If you want only panics to have backtraces, set `RUST_BACKTRACE=1` and
|
| 87 |
+
`RUST_LIB_BACKTRACE=0`.
|
| 88 |
+
|
| 89 |
+
[`std::backtrace`]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables
|
| 90 |
+
|
| 91 |
+
- Anyhow works with any error type that has an impl of `std::error::Error`,
|
| 92 |
+
including ones defined in your crate. We do not bundle a `derive(Error)` macro
|
| 93 |
+
but you can write the impls yourself or use a standalone macro like
|
| 94 |
+
[thiserror].
|
| 95 |
+
|
| 96 |
+
```rust
|
| 97 |
+
use thiserror::Error;
|
| 98 |
+
|
| 99 |
+
#[derive(Error, Debug)]
|
| 100 |
+
pub enum FormatError {
|
| 101 |
+
#[error("Invalid header (expected {expected:?}, got {found:?})")]
|
| 102 |
+
InvalidHeader {
|
| 103 |
+
expected: String,
|
| 104 |
+
found: String,
|
| 105 |
+
},
|
| 106 |
+
#[error("Missing attribute: {0}")]
|
| 107 |
+
MissingAttribute(String),
|
| 108 |
+
}
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
- One-off error messages can be constructed using the `anyhow!` macro, which
|
| 112 |
+
supports string interpolation and produces an `anyhow::Error`.
|
| 113 |
+
|
| 114 |
+
```rust
|
| 115 |
+
return Err(anyhow!("Missing attribute: {}", missing));
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
A `bail!` macro is provided as a shorthand for the same early return.
|
| 119 |
+
|
| 120 |
+
```rust
|
| 121 |
+
bail!("Missing attribute: {}", missing);
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
<br>
|
| 125 |
+
|
| 126 |
+
## No-std support
|
| 127 |
+
|
| 128 |
+
In no_std mode, almost all of the same API is available and works the same way.
|
| 129 |
+
To depend on Anyhow in no_std mode, disable our default enabled "std" feature in
|
| 130 |
+
Cargo.toml. A global allocator is required.
|
| 131 |
+
|
| 132 |
+
```toml
|
| 133 |
+
[dependencies]
|
| 134 |
+
anyhow = { version = "1.0", default-features = false }
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
With versions of Rust older than 1.81, no_std mode may require an additional
|
| 138 |
+
`.map_err(Error::msg)` when working with a non-Anyhow error type inside a
|
| 139 |
+
function that returns Anyhow's error type, as the trait that `?`-based error
|
| 140 |
+
conversions are defined by is only available in std in those old versions.
|
| 141 |
+
|
| 142 |
+
<br>
|
| 143 |
+
|
| 144 |
+
## Comparison to failure
|
| 145 |
+
|
| 146 |
+
The `anyhow::Error` type works something like `failure::Error`, but unlike
|
| 147 |
+
failure ours is built around the standard library's `std::error::Error` trait
|
| 148 |
+
rather than a separate trait `failure::Fail`. The standard library has adopted
|
| 149 |
+
the necessary improvements for this to be possible as part of [RFC 2504].
|
| 150 |
+
|
| 151 |
+
[RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
|
| 152 |
+
|
| 153 |
+
<br>
|
| 154 |
+
|
| 155 |
+
## Comparison to thiserror
|
| 156 |
+
|
| 157 |
+
Use Anyhow if you don't care what error type your functions return, you just
|
| 158 |
+
want it to be easy. This is common in application code. Use [thiserror] if you
|
| 159 |
+
are a library that wants to design your own dedicated error type(s) so that on
|
| 160 |
+
failures the caller gets exactly the information that you choose.
|
| 161 |
+
|
| 162 |
+
[thiserror]: https://github.com/dtolnay/thiserror
|
| 163 |
+
|
| 164 |
+
<br>
|
| 165 |
+
|
| 166 |
+
#### License
|
| 167 |
+
|
| 168 |
+
<sup>
|
| 169 |
+
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
|
| 170 |
+
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
|
| 171 |
+
</sup>
|
| 172 |
+
|
| 173 |
+
<br>
|
| 174 |
+
|
| 175 |
+
<sub>
|
| 176 |
+
Unless you explicitly state otherwise, any contribution intentionally submitted
|
| 177 |
+
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
|
| 178 |
+
be dual licensed as above, without any additional terms or conditions.
|
| 179 |
+
</sub>
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/build.rs
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#![allow(clippy::uninlined_format_args)]
|
| 2 |
+
|
| 3 |
+
use std::env;
|
| 4 |
+
use std::ffi::OsString;
|
| 5 |
+
use std::fs;
|
| 6 |
+
use std::io::ErrorKind;
|
| 7 |
+
use std::iter;
|
| 8 |
+
use std::path::Path;
|
| 9 |
+
use std::process::{self, Command, Stdio};
|
| 10 |
+
use std::str;
|
| 11 |
+
|
| 12 |
+
#[cfg(all(feature = "backtrace", not(feature = "std")))]
|
| 13 |
+
compile_error! {
|
| 14 |
+
"`backtrace` feature without `std` feature is not supported"
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
fn main() {
|
| 18 |
+
let mut error_generic_member_access = false;
|
| 19 |
+
if cfg!(feature = "std") {
|
| 20 |
+
println!("cargo:rerun-if-changed=src/nightly.rs");
|
| 21 |
+
|
| 22 |
+
let consider_rustc_bootstrap;
|
| 23 |
+
if compile_probe(false) {
|
| 24 |
+
// This is a nightly or dev compiler, so it supports unstable
|
| 25 |
+
// features regardless of RUSTC_BOOTSTRAP. No need to rerun build
|
| 26 |
+
// script if RUSTC_BOOTSTRAP is changed.
|
| 27 |
+
error_generic_member_access = true;
|
| 28 |
+
consider_rustc_bootstrap = false;
|
| 29 |
+
} else if let Some(rustc_bootstrap) = env::var_os("RUSTC_BOOTSTRAP") {
|
| 30 |
+
if compile_probe(true) {
|
| 31 |
+
// This is a stable or beta compiler for which the user has set
|
| 32 |
+
// RUSTC_BOOTSTRAP to turn on unstable features. Rerun build
|
| 33 |
+
// script if they change it.
|
| 34 |
+
error_generic_member_access = true;
|
| 35 |
+
consider_rustc_bootstrap = true;
|
| 36 |
+
} else if rustc_bootstrap == "1" {
|
| 37 |
+
// This compiler does not support the generic member access API
|
| 38 |
+
// in the form that anyhow expects. No need to pay attention to
|
| 39 |
+
// RUSTC_BOOTSTRAP.
|
| 40 |
+
error_generic_member_access = false;
|
| 41 |
+
consider_rustc_bootstrap = false;
|
| 42 |
+
} else {
|
| 43 |
+
// This is a stable or beta compiler for which RUSTC_BOOTSTRAP
|
| 44 |
+
// is set to restrict the use of unstable features by this
|
| 45 |
+
// crate.
|
| 46 |
+
error_generic_member_access = false;
|
| 47 |
+
consider_rustc_bootstrap = true;
|
| 48 |
+
}
|
| 49 |
+
} else {
|
| 50 |
+
// Without RUSTC_BOOTSTRAP, this compiler does not support the
|
| 51 |
+
// generic member access API in the form that anyhow expects, but
|
| 52 |
+
// try again if the user turns on unstable features.
|
| 53 |
+
error_generic_member_access = false;
|
| 54 |
+
consider_rustc_bootstrap = true;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
if error_generic_member_access {
|
| 58 |
+
println!("cargo:rustc-cfg=std_backtrace");
|
| 59 |
+
println!("cargo:rustc-cfg=error_generic_member_access");
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
if consider_rustc_bootstrap {
|
| 63 |
+
println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP");
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
let Some(rustc) = rustc_minor_version() else {
|
| 68 |
+
return;
|
| 69 |
+
};
|
| 70 |
+
|
| 71 |
+
if rustc >= 80 {
|
| 72 |
+
println!("cargo:rustc-check-cfg=cfg(anyhow_build_probe)");
|
| 73 |
+
println!("cargo:rustc-check-cfg=cfg(anyhow_nightly_testing)");
|
| 74 |
+
println!("cargo:rustc-check-cfg=cfg(anyhow_no_clippy_format_args)");
|
| 75 |
+
println!("cargo:rustc-check-cfg=cfg(anyhow_no_core_error)");
|
| 76 |
+
println!("cargo:rustc-check-cfg=cfg(error_generic_member_access)");
|
| 77 |
+
println!("cargo:rustc-check-cfg=cfg(std_backtrace)");
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
if !error_generic_member_access && cfg!(feature = "std") {
|
| 81 |
+
// std::backtrace::Backtrace
|
| 82 |
+
// https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#stabilized-apis
|
| 83 |
+
println!("cargo:rustc-cfg=std_backtrace");
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
if rustc < 81 {
|
| 87 |
+
// core::error::Error
|
| 88 |
+
// https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#coreerrorerror
|
| 89 |
+
println!("cargo:rustc-cfg=anyhow_no_core_error");
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
if rustc < 85 {
|
| 93 |
+
// #[clippy::format_args]
|
| 94 |
+
// https://doc.rust-lang.org/1.85.1/clippy/attribs.html#clippyformat_args
|
| 95 |
+
println!("cargo:rustc-cfg=anyhow_no_clippy_format_args");
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
fn compile_probe(rustc_bootstrap: bool) -> bool {
|
| 100 |
+
if env::var_os("RUSTC_STAGE").is_some() {
|
| 101 |
+
// We are running inside rustc bootstrap. This is a highly non-standard
|
| 102 |
+
// environment with issues such as:
|
| 103 |
+
//
|
| 104 |
+
// https://github.com/rust-lang/cargo/issues/11138
|
| 105 |
+
// https://github.com/rust-lang/rust/issues/114839
|
| 106 |
+
//
|
| 107 |
+
// Let's just not use nightly features here.
|
| 108 |
+
return false;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
let rustc = cargo_env_var("RUSTC");
|
| 112 |
+
let out_dir = cargo_env_var("OUT_DIR");
|
| 113 |
+
let out_subdir = Path::new(&out_dir).join("probe");
|
| 114 |
+
let probefile = Path::new("src").join("nightly.rs");
|
| 115 |
+
|
| 116 |
+
if let Err(err) = fs::create_dir(&out_subdir) {
|
| 117 |
+
if err.kind() != ErrorKind::AlreadyExists {
|
| 118 |
+
eprintln!("Failed to create {}: {}", out_subdir.display(), err);
|
| 119 |
+
process::exit(1);
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty());
|
| 124 |
+
let rustc_workspace_wrapper =
|
| 125 |
+
env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty());
|
| 126 |
+
let mut rustc = rustc_wrapper
|
| 127 |
+
.into_iter()
|
| 128 |
+
.chain(rustc_workspace_wrapper)
|
| 129 |
+
.chain(iter::once(rustc));
|
| 130 |
+
let mut cmd = Command::new(rustc.next().unwrap());
|
| 131 |
+
cmd.args(rustc);
|
| 132 |
+
|
| 133 |
+
if !rustc_bootstrap {
|
| 134 |
+
cmd.env_remove("RUSTC_BOOTSTRAP");
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
cmd.stderr(Stdio::null())
|
| 138 |
+
.arg("--cfg=anyhow_build_probe")
|
| 139 |
+
.arg("--edition=2018")
|
| 140 |
+
.arg("--crate-name=anyhow")
|
| 141 |
+
.arg("--crate-type=lib")
|
| 142 |
+
.arg("--cap-lints=allow")
|
| 143 |
+
.arg("--emit=dep-info,metadata")
|
| 144 |
+
.arg("--out-dir")
|
| 145 |
+
.arg(&out_subdir)
|
| 146 |
+
.arg(probefile);
|
| 147 |
+
|
| 148 |
+
if let Some(target) = env::var_os("TARGET") {
|
| 149 |
+
cmd.arg("--target").arg(target);
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
// If Cargo wants to set RUSTFLAGS, use that.
|
| 153 |
+
if let Ok(rustflags) = env::var("CARGO_ENCODED_RUSTFLAGS") {
|
| 154 |
+
if !rustflags.is_empty() {
|
| 155 |
+
for arg in rustflags.split('\x1f') {
|
| 156 |
+
cmd.arg(arg);
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
let success = match cmd.status() {
|
| 162 |
+
Ok(status) => status.success(),
|
| 163 |
+
Err(_) => false,
|
| 164 |
+
};
|
| 165 |
+
|
| 166 |
+
// Clean up to avoid leaving nondeterministic absolute paths in the dep-info
|
| 167 |
+
// file in OUT_DIR, which causes nonreproducible builds in build systems
|
| 168 |
+
// that treat the entire OUT_DIR as an artifact.
|
| 169 |
+
if let Err(err) = fs::remove_dir_all(&out_subdir) {
|
| 170 |
+
// libc::ENOTEMPTY
|
| 171 |
+
// Some filesystems (NFSv3) have timing issues under load where '.nfs*'
|
| 172 |
+
// dummy files can continue to get created for a short period after the
|
| 173 |
+
// probe command completes, breaking remove_dir_all.
|
| 174 |
+
// To be replaced with ErrorKind::DirectoryNotEmpty (Rust 1.83+).
|
| 175 |
+
const ENOTEMPTY: i32 = 39;
|
| 176 |
+
|
| 177 |
+
if !(err.kind() == ErrorKind::NotFound
|
| 178 |
+
|| (cfg!(target_os = "linux") && err.raw_os_error() == Some(ENOTEMPTY)))
|
| 179 |
+
{
|
| 180 |
+
eprintln!("Failed to clean up {}: {}", out_subdir.display(), err);
|
| 181 |
+
process::exit(1);
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
success
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
fn rustc_minor_version() -> Option<u32> {
|
| 189 |
+
let rustc = cargo_env_var("RUSTC");
|
| 190 |
+
let output = Command::new(rustc).arg("--version").output().ok()?;
|
| 191 |
+
let version = str::from_utf8(&output.stdout).ok()?;
|
| 192 |
+
let mut pieces = version.split('.');
|
| 193 |
+
if pieces.next() != Some("rustc 1") {
|
| 194 |
+
return None;
|
| 195 |
+
}
|
| 196 |
+
pieces.next()?.parse().ok()
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
fn cargo_env_var(key: &str) -> OsString {
|
| 200 |
+
env::var_os(key).unwrap_or_else(|| {
|
| 201 |
+
eprintln!(
|
| 202 |
+
"Environment variable ${} is not set during execution of build script",
|
| 203 |
+
key,
|
| 204 |
+
);
|
| 205 |
+
process::exit(1);
|
| 206 |
+
})
|
| 207 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.101/rust-toolchain.toml
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[toolchain]
|
| 2 |
+
components = ["rust-src"]
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/.cargo-ok
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"v":1}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/.cargo_vcs_info.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"git": {
|
| 3 |
+
"sha1": "20aac9d46e0852292bd43d845b6d9cb69c598c9e"
|
| 4 |
+
},
|
| 5 |
+
"path_in_vcs": ""
|
| 6 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/Cargo.lock
ADDED
|
@@ -0,0 +1,917 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This file is automatically @generated by Cargo.
|
| 2 |
+
# It is not intended for manual editing.
|
| 3 |
+
version = 3
|
| 4 |
+
|
| 5 |
+
[[package]]
|
| 6 |
+
name = "addr2line"
|
| 7 |
+
version = "0.22.0"
|
| 8 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 9 |
+
checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
|
| 10 |
+
dependencies = [
|
| 11 |
+
"gimli",
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
[[package]]
|
| 15 |
+
name = "adler"
|
| 16 |
+
version = "1.0.2"
|
| 17 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 18 |
+
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
| 19 |
+
|
| 20 |
+
[[package]]
|
| 21 |
+
name = "anstream"
|
| 22 |
+
version = "0.6.14"
|
| 23 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 24 |
+
checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
|
| 25 |
+
dependencies = [
|
| 26 |
+
"anstyle",
|
| 27 |
+
"anstyle-parse",
|
| 28 |
+
"anstyle-query",
|
| 29 |
+
"anstyle-wincon",
|
| 30 |
+
"colorchoice",
|
| 31 |
+
"is_terminal_polyfill",
|
| 32 |
+
"utf8parse",
|
| 33 |
+
]
|
| 34 |
+
|
| 35 |
+
[[package]]
|
| 36 |
+
name = "anstyle"
|
| 37 |
+
version = "1.0.10"
|
| 38 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 39 |
+
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
|
| 40 |
+
|
| 41 |
+
[[package]]
|
| 42 |
+
name = "anstyle-lossy"
|
| 43 |
+
version = "1.1.3"
|
| 44 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 45 |
+
checksum = "934ff8719effd2023a48cf63e69536c1c3ced9d3895068f6f5cc9a4ff845e59b"
|
| 46 |
+
dependencies = [
|
| 47 |
+
"anstyle",
|
| 48 |
+
]
|
| 49 |
+
|
| 50 |
+
[[package]]
|
| 51 |
+
name = "anstyle-parse"
|
| 52 |
+
version = "0.2.4"
|
| 53 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 54 |
+
checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
|
| 55 |
+
dependencies = [
|
| 56 |
+
"utf8parse",
|
| 57 |
+
]
|
| 58 |
+
|
| 59 |
+
[[package]]
|
| 60 |
+
name = "anstyle-query"
|
| 61 |
+
version = "1.1.0"
|
| 62 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 63 |
+
checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391"
|
| 64 |
+
dependencies = [
|
| 65 |
+
"windows-sys 0.52.0",
|
| 66 |
+
]
|
| 67 |
+
|
| 68 |
+
[[package]]
|
| 69 |
+
name = "anstyle-svg"
|
| 70 |
+
version = "0.1.7"
|
| 71 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 72 |
+
checksum = "d3607949e9f6de49ea4bafe12f5e4fd73613ebf24795e48587302a8cc0e4bb35"
|
| 73 |
+
dependencies = [
|
| 74 |
+
"anstream",
|
| 75 |
+
"anstyle",
|
| 76 |
+
"anstyle-lossy",
|
| 77 |
+
"html-escape",
|
| 78 |
+
"unicode-width",
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
+
[[package]]
|
| 82 |
+
name = "anstyle-wincon"
|
| 83 |
+
version = "3.0.3"
|
| 84 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 85 |
+
checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
|
| 86 |
+
dependencies = [
|
| 87 |
+
"anstyle",
|
| 88 |
+
"windows-sys 0.52.0",
|
| 89 |
+
]
|
| 90 |
+
|
| 91 |
+
[[package]]
|
| 92 |
+
name = "automod"
|
| 93 |
+
version = "1.0.15"
|
| 94 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 95 |
+
checksum = "ebb4bd301db2e2ca1f5be131c24eb8ebf2d9559bc3744419e93baf8ddea7e670"
|
| 96 |
+
dependencies = [
|
| 97 |
+
"proc-macro2",
|
| 98 |
+
"quote",
|
| 99 |
+
"syn",
|
| 100 |
+
]
|
| 101 |
+
|
| 102 |
+
[[package]]
|
| 103 |
+
name = "backtrace"
|
| 104 |
+
version = "0.3.73"
|
| 105 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 106 |
+
checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
|
| 107 |
+
dependencies = [
|
| 108 |
+
"addr2line",
|
| 109 |
+
"cc",
|
| 110 |
+
"cfg-if",
|
| 111 |
+
"libc",
|
| 112 |
+
"miniz_oxide",
|
| 113 |
+
"object",
|
| 114 |
+
"rustc-demangle",
|
| 115 |
+
]
|
| 116 |
+
|
| 117 |
+
[[package]]
|
| 118 |
+
name = "bitflags"
|
| 119 |
+
version = "2.6.0"
|
| 120 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 121 |
+
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
| 122 |
+
|
| 123 |
+
[[package]]
|
| 124 |
+
name = "cc"
|
| 125 |
+
version = "1.1.0"
|
| 126 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 127 |
+
checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8"
|
| 128 |
+
|
| 129 |
+
[[package]]
|
| 130 |
+
name = "cfg-if"
|
| 131 |
+
version = "1.0.0"
|
| 132 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 133 |
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
| 134 |
+
|
| 135 |
+
[[package]]
|
| 136 |
+
name = "clap"
|
| 137 |
+
version = "4.5.60"
|
| 138 |
+
dependencies = [
|
| 139 |
+
"automod",
|
| 140 |
+
"clap-cargo",
|
| 141 |
+
"clap_builder",
|
| 142 |
+
"clap_derive",
|
| 143 |
+
"jiff",
|
| 144 |
+
"rustversion",
|
| 145 |
+
"semver",
|
| 146 |
+
"shlex",
|
| 147 |
+
"snapbox",
|
| 148 |
+
"trybuild",
|
| 149 |
+
"trycmd",
|
| 150 |
+
]
|
| 151 |
+
|
| 152 |
+
[[package]]
|
| 153 |
+
name = "clap-cargo"
|
| 154 |
+
version = "0.15.2"
|
| 155 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 156 |
+
checksum = "d546f0e84ff2bfa4da1ce9b54be42285767ba39c688572ca32412a09a73851e5"
|
| 157 |
+
dependencies = [
|
| 158 |
+
"anstyle",
|
| 159 |
+
]
|
| 160 |
+
|
| 161 |
+
[[package]]
|
| 162 |
+
name = "clap_builder"
|
| 163 |
+
version = "4.5.60"
|
| 164 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 165 |
+
checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876"
|
| 166 |
+
dependencies = [
|
| 167 |
+
"anstream",
|
| 168 |
+
"anstyle",
|
| 169 |
+
"backtrace",
|
| 170 |
+
"clap_lex",
|
| 171 |
+
"strsim",
|
| 172 |
+
"terminal_size",
|
| 173 |
+
"unicase",
|
| 174 |
+
"unicode-width",
|
| 175 |
+
]
|
| 176 |
+
|
| 177 |
+
[[package]]
|
| 178 |
+
name = "clap_derive"
|
| 179 |
+
version = "4.5.55"
|
| 180 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 181 |
+
checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5"
|
| 182 |
+
dependencies = [
|
| 183 |
+
"anstyle",
|
| 184 |
+
"heck",
|
| 185 |
+
"proc-macro2",
|
| 186 |
+
"pulldown-cmark",
|
| 187 |
+
"quote",
|
| 188 |
+
"syn",
|
| 189 |
+
]
|
| 190 |
+
|
| 191 |
+
[[package]]
|
| 192 |
+
name = "clap_lex"
|
| 193 |
+
version = "1.0.0"
|
| 194 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 195 |
+
checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831"
|
| 196 |
+
|
| 197 |
+
[[package]]
|
| 198 |
+
name = "colorchoice"
|
| 199 |
+
version = "1.0.1"
|
| 200 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 201 |
+
checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
|
| 202 |
+
|
| 203 |
+
[[package]]
|
| 204 |
+
name = "crossbeam-deque"
|
| 205 |
+
version = "0.8.5"
|
| 206 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 207 |
+
checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
|
| 208 |
+
dependencies = [
|
| 209 |
+
"crossbeam-epoch",
|
| 210 |
+
"crossbeam-utils",
|
| 211 |
+
]
|
| 212 |
+
|
| 213 |
+
[[package]]
|
| 214 |
+
name = "crossbeam-epoch"
|
| 215 |
+
version = "0.9.18"
|
| 216 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 217 |
+
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
| 218 |
+
dependencies = [
|
| 219 |
+
"crossbeam-utils",
|
| 220 |
+
]
|
| 221 |
+
|
| 222 |
+
[[package]]
|
| 223 |
+
name = "crossbeam-utils"
|
| 224 |
+
version = "0.8.20"
|
| 225 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 226 |
+
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
|
| 227 |
+
|
| 228 |
+
[[package]]
|
| 229 |
+
name = "either"
|
| 230 |
+
version = "1.13.0"
|
| 231 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 232 |
+
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
| 233 |
+
|
| 234 |
+
[[package]]
|
| 235 |
+
name = "equivalent"
|
| 236 |
+
version = "1.0.1"
|
| 237 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 238 |
+
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
| 239 |
+
|
| 240 |
+
[[package]]
|
| 241 |
+
name = "errno"
|
| 242 |
+
version = "0.3.9"
|
| 243 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 244 |
+
checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
|
| 245 |
+
dependencies = [
|
| 246 |
+
"libc",
|
| 247 |
+
"windows-sys 0.52.0",
|
| 248 |
+
]
|
| 249 |
+
|
| 250 |
+
[[package]]
|
| 251 |
+
name = "escargot"
|
| 252 |
+
version = "0.5.13"
|
| 253 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 254 |
+
checksum = "05a3ac187a16b5382fef8c69fd1bad123c67b7cf3932240a2d43dcdd32cded88"
|
| 255 |
+
dependencies = [
|
| 256 |
+
"log",
|
| 257 |
+
"once_cell",
|
| 258 |
+
"serde",
|
| 259 |
+
"serde_json",
|
| 260 |
+
]
|
| 261 |
+
|
| 262 |
+
[[package]]
|
| 263 |
+
name = "gimli"
|
| 264 |
+
version = "0.29.0"
|
| 265 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 266 |
+
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
|
| 267 |
+
|
| 268 |
+
[[package]]
|
| 269 |
+
name = "glob"
|
| 270 |
+
version = "0.3.1"
|
| 271 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 272 |
+
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
| 273 |
+
|
| 274 |
+
[[package]]
|
| 275 |
+
name = "hashbrown"
|
| 276 |
+
version = "0.14.5"
|
| 277 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 278 |
+
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
|
| 279 |
+
|
| 280 |
+
[[package]]
|
| 281 |
+
name = "heck"
|
| 282 |
+
version = "0.5.0"
|
| 283 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 284 |
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
| 285 |
+
|
| 286 |
+
[[package]]
|
| 287 |
+
name = "html-escape"
|
| 288 |
+
version = "0.2.13"
|
| 289 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 290 |
+
checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476"
|
| 291 |
+
dependencies = [
|
| 292 |
+
"utf8-width",
|
| 293 |
+
]
|
| 294 |
+
|
| 295 |
+
[[package]]
|
| 296 |
+
name = "humantime"
|
| 297 |
+
version = "2.1.0"
|
| 298 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 299 |
+
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
| 300 |
+
|
| 301 |
+
[[package]]
|
| 302 |
+
name = "humantime-serde"
|
| 303 |
+
version = "1.1.1"
|
| 304 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 305 |
+
checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
|
| 306 |
+
dependencies = [
|
| 307 |
+
"humantime",
|
| 308 |
+
"serde",
|
| 309 |
+
]
|
| 310 |
+
|
| 311 |
+
[[package]]
|
| 312 |
+
name = "indexmap"
|
| 313 |
+
version = "2.2.6"
|
| 314 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 315 |
+
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
|
| 316 |
+
dependencies = [
|
| 317 |
+
"equivalent",
|
| 318 |
+
"hashbrown",
|
| 319 |
+
]
|
| 320 |
+
|
| 321 |
+
[[package]]
|
| 322 |
+
name = "is_terminal_polyfill"
|
| 323 |
+
version = "1.70.0"
|
| 324 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 325 |
+
checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
|
| 326 |
+
|
| 327 |
+
[[package]]
|
| 328 |
+
name = "itoa"
|
| 329 |
+
version = "1.0.11"
|
| 330 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 331 |
+
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
| 332 |
+
|
| 333 |
+
[[package]]
|
| 334 |
+
name = "jiff"
|
| 335 |
+
version = "0.2.15"
|
| 336 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 337 |
+
checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49"
|
| 338 |
+
dependencies = [
|
| 339 |
+
"jiff-static",
|
| 340 |
+
"jiff-tzdb-platform",
|
| 341 |
+
"log",
|
| 342 |
+
"portable-atomic",
|
| 343 |
+
"portable-atomic-util",
|
| 344 |
+
"serde",
|
| 345 |
+
"windows-sys 0.59.0",
|
| 346 |
+
]
|
| 347 |
+
|
| 348 |
+
[[package]]
|
| 349 |
+
name = "jiff-static"
|
| 350 |
+
version = "0.2.15"
|
| 351 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 352 |
+
checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4"
|
| 353 |
+
dependencies = [
|
| 354 |
+
"proc-macro2",
|
| 355 |
+
"quote",
|
| 356 |
+
"syn",
|
| 357 |
+
]
|
| 358 |
+
|
| 359 |
+
[[package]]
|
| 360 |
+
name = "jiff-tzdb"
|
| 361 |
+
version = "0.1.4"
|
| 362 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 363 |
+
checksum = "c1283705eb0a21404d2bfd6eef2a7593d240bc42a0bdb39db0ad6fa2ec026524"
|
| 364 |
+
|
| 365 |
+
[[package]]
|
| 366 |
+
name = "jiff-tzdb-platform"
|
| 367 |
+
version = "0.1.3"
|
| 368 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 369 |
+
checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8"
|
| 370 |
+
dependencies = [
|
| 371 |
+
"jiff-tzdb",
|
| 372 |
+
]
|
| 373 |
+
|
| 374 |
+
[[package]]
|
| 375 |
+
name = "libc"
|
| 376 |
+
version = "0.2.155"
|
| 377 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 378 |
+
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
| 379 |
+
|
| 380 |
+
[[package]]
|
| 381 |
+
name = "linux-raw-sys"
|
| 382 |
+
version = "0.4.14"
|
| 383 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 384 |
+
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
|
| 385 |
+
|
| 386 |
+
[[package]]
|
| 387 |
+
name = "log"
|
| 388 |
+
version = "0.4.22"
|
| 389 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 390 |
+
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
| 391 |
+
|
| 392 |
+
[[package]]
|
| 393 |
+
name = "memchr"
|
| 394 |
+
version = "2.7.4"
|
| 395 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 396 |
+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
| 397 |
+
|
| 398 |
+
[[package]]
|
| 399 |
+
name = "miniz_oxide"
|
| 400 |
+
version = "0.7.4"
|
| 401 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 402 |
+
checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
|
| 403 |
+
dependencies = [
|
| 404 |
+
"adler",
|
| 405 |
+
]
|
| 406 |
+
|
| 407 |
+
[[package]]
|
| 408 |
+
name = "normalize-line-endings"
|
| 409 |
+
version = "0.3.0"
|
| 410 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 411 |
+
checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
|
| 412 |
+
|
| 413 |
+
[[package]]
|
| 414 |
+
name = "object"
|
| 415 |
+
version = "0.36.1"
|
| 416 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 417 |
+
checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
|
| 418 |
+
dependencies = [
|
| 419 |
+
"memchr",
|
| 420 |
+
]
|
| 421 |
+
|
| 422 |
+
[[package]]
|
| 423 |
+
name = "once_cell"
|
| 424 |
+
version = "1.19.0"
|
| 425 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 426 |
+
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
| 427 |
+
|
| 428 |
+
[[package]]
|
| 429 |
+
name = "os_pipe"
|
| 430 |
+
version = "1.2.0"
|
| 431 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 432 |
+
checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209"
|
| 433 |
+
dependencies = [
|
| 434 |
+
"libc",
|
| 435 |
+
"windows-sys 0.52.0",
|
| 436 |
+
]
|
| 437 |
+
|
| 438 |
+
[[package]]
|
| 439 |
+
name = "portable-atomic"
|
| 440 |
+
version = "1.11.0"
|
| 441 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 442 |
+
checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
|
| 443 |
+
|
| 444 |
+
[[package]]
|
| 445 |
+
name = "portable-atomic-util"
|
| 446 |
+
version = "0.2.4"
|
| 447 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 448 |
+
checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
|
| 449 |
+
dependencies = [
|
| 450 |
+
"portable-atomic",
|
| 451 |
+
]
|
| 452 |
+
|
| 453 |
+
[[package]]
|
| 454 |
+
name = "proc-macro2"
|
| 455 |
+
version = "1.0.94"
|
| 456 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 457 |
+
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
|
| 458 |
+
dependencies = [
|
| 459 |
+
"unicode-ident",
|
| 460 |
+
]
|
| 461 |
+
|
| 462 |
+
[[package]]
|
| 463 |
+
name = "pulldown-cmark"
|
| 464 |
+
version = "0.13.0"
|
| 465 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 466 |
+
checksum = "1e8bbe1a966bd2f362681a44f6edce3c2310ac21e4d5067a6e7ec396297a6ea0"
|
| 467 |
+
dependencies = [
|
| 468 |
+
"bitflags",
|
| 469 |
+
"memchr",
|
| 470 |
+
"unicase",
|
| 471 |
+
]
|
| 472 |
+
|
| 473 |
+
[[package]]
|
| 474 |
+
name = "quote"
|
| 475 |
+
version = "1.0.39"
|
| 476 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 477 |
+
checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801"
|
| 478 |
+
dependencies = [
|
| 479 |
+
"proc-macro2",
|
| 480 |
+
]
|
| 481 |
+
|
| 482 |
+
[[package]]
|
| 483 |
+
name = "rayon"
|
| 484 |
+
version = "1.10.0"
|
| 485 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 486 |
+
checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
|
| 487 |
+
dependencies = [
|
| 488 |
+
"either",
|
| 489 |
+
"rayon-core",
|
| 490 |
+
]
|
| 491 |
+
|
| 492 |
+
[[package]]
|
| 493 |
+
name = "rayon-core"
|
| 494 |
+
version = "1.12.1"
|
| 495 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 496 |
+
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
|
| 497 |
+
dependencies = [
|
| 498 |
+
"crossbeam-deque",
|
| 499 |
+
"crossbeam-utils",
|
| 500 |
+
]
|
| 501 |
+
|
| 502 |
+
[[package]]
|
| 503 |
+
name = "rustc-demangle"
|
| 504 |
+
version = "0.1.24"
|
| 505 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 506 |
+
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
|
| 507 |
+
|
| 508 |
+
[[package]]
|
| 509 |
+
name = "rustix"
|
| 510 |
+
version = "0.38.34"
|
| 511 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 512 |
+
checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
|
| 513 |
+
dependencies = [
|
| 514 |
+
"bitflags",
|
| 515 |
+
"errno",
|
| 516 |
+
"libc",
|
| 517 |
+
"linux-raw-sys",
|
| 518 |
+
"windows-sys 0.52.0",
|
| 519 |
+
]
|
| 520 |
+
|
| 521 |
+
[[package]]
|
| 522 |
+
name = "rustversion"
|
| 523 |
+
version = "1.0.21"
|
| 524 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 525 |
+
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"
|
| 526 |
+
|
| 527 |
+
[[package]]
|
| 528 |
+
name = "ryu"
|
| 529 |
+
version = "1.0.18"
|
| 530 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 531 |
+
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
| 532 |
+
|
| 533 |
+
[[package]]
|
| 534 |
+
name = "semver"
|
| 535 |
+
version = "1.0.26"
|
| 536 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 537 |
+
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
|
| 538 |
+
|
| 539 |
+
[[package]]
|
| 540 |
+
name = "serde"
|
| 541 |
+
version = "1.0.204"
|
| 542 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 543 |
+
checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
|
| 544 |
+
dependencies = [
|
| 545 |
+
"serde_derive",
|
| 546 |
+
]
|
| 547 |
+
|
| 548 |
+
[[package]]
|
| 549 |
+
name = "serde_derive"
|
| 550 |
+
version = "1.0.204"
|
| 551 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 552 |
+
checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
|
| 553 |
+
dependencies = [
|
| 554 |
+
"proc-macro2",
|
| 555 |
+
"quote",
|
| 556 |
+
"syn",
|
| 557 |
+
]
|
| 558 |
+
|
| 559 |
+
[[package]]
|
| 560 |
+
name = "serde_json"
|
| 561 |
+
version = "1.0.120"
|
| 562 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 563 |
+
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
|
| 564 |
+
dependencies = [
|
| 565 |
+
"itoa",
|
| 566 |
+
"ryu",
|
| 567 |
+
"serde",
|
| 568 |
+
]
|
| 569 |
+
|
| 570 |
+
[[package]]
|
| 571 |
+
name = "serde_spanned"
|
| 572 |
+
version = "0.6.6"
|
| 573 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 574 |
+
checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0"
|
| 575 |
+
dependencies = [
|
| 576 |
+
"serde",
|
| 577 |
+
]
|
| 578 |
+
|
| 579 |
+
[[package]]
|
| 580 |
+
name = "serde_spanned"
|
| 581 |
+
version = "1.0.0"
|
| 582 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 583 |
+
checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83"
|
| 584 |
+
dependencies = [
|
| 585 |
+
"serde",
|
| 586 |
+
]
|
| 587 |
+
|
| 588 |
+
[[package]]
|
| 589 |
+
name = "shlex"
|
| 590 |
+
version = "1.3.0"
|
| 591 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 592 |
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
| 593 |
+
|
| 594 |
+
[[package]]
|
| 595 |
+
name = "similar"
|
| 596 |
+
version = "2.5.0"
|
| 597 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 598 |
+
checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640"
|
| 599 |
+
|
| 600 |
+
[[package]]
|
| 601 |
+
name = "snapbox"
|
| 602 |
+
version = "0.6.21"
|
| 603 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 604 |
+
checksum = "96dcfc4581e3355d70ac2ee14cfdf81dce3d85c85f1ed9e2c1d3013f53b3436b"
|
| 605 |
+
dependencies = [
|
| 606 |
+
"anstream",
|
| 607 |
+
"anstyle",
|
| 608 |
+
"anstyle-svg",
|
| 609 |
+
"escargot",
|
| 610 |
+
"libc",
|
| 611 |
+
"normalize-line-endings",
|
| 612 |
+
"os_pipe",
|
| 613 |
+
"serde_json",
|
| 614 |
+
"similar",
|
| 615 |
+
"snapbox-macros",
|
| 616 |
+
"wait-timeout",
|
| 617 |
+
"windows-sys 0.59.0",
|
| 618 |
+
]
|
| 619 |
+
|
| 620 |
+
[[package]]
|
| 621 |
+
name = "snapbox-macros"
|
| 622 |
+
version = "0.3.10"
|
| 623 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 624 |
+
checksum = "16569f53ca23a41bb6f62e0a5084aa1661f4814a67fa33696a79073e03a664af"
|
| 625 |
+
dependencies = [
|
| 626 |
+
"anstream",
|
| 627 |
+
]
|
| 628 |
+
|
| 629 |
+
[[package]]
|
| 630 |
+
name = "strsim"
|
| 631 |
+
version = "0.11.1"
|
| 632 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 633 |
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
| 634 |
+
|
| 635 |
+
[[package]]
|
| 636 |
+
name = "syn"
|
| 637 |
+
version = "2.0.99"
|
| 638 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 639 |
+
checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2"
|
| 640 |
+
dependencies = [
|
| 641 |
+
"proc-macro2",
|
| 642 |
+
"quote",
|
| 643 |
+
"unicode-ident",
|
| 644 |
+
]
|
| 645 |
+
|
| 646 |
+
[[package]]
|
| 647 |
+
name = "target-triple"
|
| 648 |
+
version = "0.1.3"
|
| 649 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 650 |
+
checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078"
|
| 651 |
+
|
| 652 |
+
[[package]]
|
| 653 |
+
name = "termcolor"
|
| 654 |
+
version = "1.4.1"
|
| 655 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 656 |
+
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
| 657 |
+
dependencies = [
|
| 658 |
+
"winapi-util",
|
| 659 |
+
]
|
| 660 |
+
|
| 661 |
+
[[package]]
|
| 662 |
+
name = "terminal_size"
|
| 663 |
+
version = "0.4.0"
|
| 664 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 665 |
+
checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef"
|
| 666 |
+
dependencies = [
|
| 667 |
+
"rustix",
|
| 668 |
+
"windows-sys 0.59.0",
|
| 669 |
+
]
|
| 670 |
+
|
| 671 |
+
[[package]]
|
| 672 |
+
name = "toml"
|
| 673 |
+
version = "0.9.0"
|
| 674 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 675 |
+
checksum = "f271e09bde39ab52250160a67e88577e0559ad77e9085de6e9051a2c4353f8f8"
|
| 676 |
+
dependencies = [
|
| 677 |
+
"indexmap",
|
| 678 |
+
"serde",
|
| 679 |
+
"serde_spanned 1.0.0",
|
| 680 |
+
"toml_datetime 0.7.0",
|
| 681 |
+
"toml_parser",
|
| 682 |
+
"toml_writer",
|
| 683 |
+
"winnow 0.7.11",
|
| 684 |
+
]
|
| 685 |
+
|
| 686 |
+
[[package]]
|
| 687 |
+
name = "toml_datetime"
|
| 688 |
+
version = "0.6.6"
|
| 689 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 690 |
+
checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
|
| 691 |
+
dependencies = [
|
| 692 |
+
"serde",
|
| 693 |
+
]
|
| 694 |
+
|
| 695 |
+
[[package]]
|
| 696 |
+
name = "toml_datetime"
|
| 697 |
+
version = "0.7.0"
|
| 698 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 699 |
+
checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3"
|
| 700 |
+
dependencies = [
|
| 701 |
+
"serde",
|
| 702 |
+
]
|
| 703 |
+
|
| 704 |
+
[[package]]
|
| 705 |
+
name = "toml_edit"
|
| 706 |
+
version = "0.22.15"
|
| 707 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 708 |
+
checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1"
|
| 709 |
+
dependencies = [
|
| 710 |
+
"indexmap",
|
| 711 |
+
"serde",
|
| 712 |
+
"serde_spanned 0.6.6",
|
| 713 |
+
"toml_datetime 0.6.6",
|
| 714 |
+
"winnow 0.6.13",
|
| 715 |
+
]
|
| 716 |
+
|
| 717 |
+
[[package]]
|
| 718 |
+
name = "toml_parser"
|
| 719 |
+
version = "1.0.0"
|
| 720 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 721 |
+
checksum = "b5c1c469eda89749d2230d8156a5969a69ffe0d6d01200581cdc6110674d293e"
|
| 722 |
+
dependencies = [
|
| 723 |
+
"winnow 0.7.11",
|
| 724 |
+
]
|
| 725 |
+
|
| 726 |
+
[[package]]
|
| 727 |
+
name = "toml_writer"
|
| 728 |
+
version = "1.0.0"
|
| 729 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 730 |
+
checksum = "b679217f2848de74cabd3e8fc5e6d66f40b7da40f8e1954d92054d9010690fd5"
|
| 731 |
+
|
| 732 |
+
[[package]]
|
| 733 |
+
name = "trybuild"
|
| 734 |
+
version = "1.0.106"
|
| 735 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 736 |
+
checksum = "65af40ad689f2527aebbd37a0a816aea88ff5f774ceabe99de5be02f2f91dae2"
|
| 737 |
+
dependencies = [
|
| 738 |
+
"glob",
|
| 739 |
+
"serde",
|
| 740 |
+
"serde_derive",
|
| 741 |
+
"serde_json",
|
| 742 |
+
"target-triple",
|
| 743 |
+
"termcolor",
|
| 744 |
+
"toml",
|
| 745 |
+
]
|
| 746 |
+
|
| 747 |
+
[[package]]
|
| 748 |
+
name = "trycmd"
|
| 749 |
+
version = "0.15.9"
|
| 750 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 751 |
+
checksum = "a8b5cf29388862aac065d6597ac9c8e842d1cc827cb50f7c32f11d29442eaae4"
|
| 752 |
+
dependencies = [
|
| 753 |
+
"anstream",
|
| 754 |
+
"automod",
|
| 755 |
+
"glob",
|
| 756 |
+
"humantime",
|
| 757 |
+
"humantime-serde",
|
| 758 |
+
"rayon",
|
| 759 |
+
"serde",
|
| 760 |
+
"shlex",
|
| 761 |
+
"snapbox",
|
| 762 |
+
"toml_edit",
|
| 763 |
+
]
|
| 764 |
+
|
| 765 |
+
[[package]]
|
| 766 |
+
name = "unicase"
|
| 767 |
+
version = "2.7.0"
|
| 768 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 769 |
+
checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
|
| 770 |
+
dependencies = [
|
| 771 |
+
"version_check",
|
| 772 |
+
]
|
| 773 |
+
|
| 774 |
+
[[package]]
|
| 775 |
+
name = "unicode-ident"
|
| 776 |
+
version = "1.0.12"
|
| 777 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 778 |
+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
| 779 |
+
|
| 780 |
+
[[package]]
|
| 781 |
+
name = "unicode-width"
|
| 782 |
+
version = "0.2.0"
|
| 783 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 784 |
+
checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
|
| 785 |
+
|
| 786 |
+
[[package]]
|
| 787 |
+
name = "utf8-width"
|
| 788 |
+
version = "0.1.7"
|
| 789 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 790 |
+
checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3"
|
| 791 |
+
|
| 792 |
+
[[package]]
|
| 793 |
+
name = "utf8parse"
|
| 794 |
+
version = "0.2.2"
|
| 795 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 796 |
+
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
| 797 |
+
|
| 798 |
+
[[package]]
|
| 799 |
+
name = "version_check"
|
| 800 |
+
version = "0.9.4"
|
| 801 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 802 |
+
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
| 803 |
+
|
| 804 |
+
[[package]]
|
| 805 |
+
name = "wait-timeout"
|
| 806 |
+
version = "0.2.0"
|
| 807 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 808 |
+
checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
|
| 809 |
+
dependencies = [
|
| 810 |
+
"libc",
|
| 811 |
+
]
|
| 812 |
+
|
| 813 |
+
[[package]]
|
| 814 |
+
name = "winapi-util"
|
| 815 |
+
version = "0.1.8"
|
| 816 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 817 |
+
checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b"
|
| 818 |
+
dependencies = [
|
| 819 |
+
"windows-sys 0.52.0",
|
| 820 |
+
]
|
| 821 |
+
|
| 822 |
+
[[package]]
|
| 823 |
+
name = "windows-sys"
|
| 824 |
+
version = "0.52.0"
|
| 825 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 826 |
+
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
| 827 |
+
dependencies = [
|
| 828 |
+
"windows-targets",
|
| 829 |
+
]
|
| 830 |
+
|
| 831 |
+
[[package]]
|
| 832 |
+
name = "windows-sys"
|
| 833 |
+
version = "0.59.0"
|
| 834 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 835 |
+
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
| 836 |
+
dependencies = [
|
| 837 |
+
"windows-targets",
|
| 838 |
+
]
|
| 839 |
+
|
| 840 |
+
[[package]]
|
| 841 |
+
name = "windows-targets"
|
| 842 |
+
version = "0.52.6"
|
| 843 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 844 |
+
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
| 845 |
+
dependencies = [
|
| 846 |
+
"windows_aarch64_gnullvm",
|
| 847 |
+
"windows_aarch64_msvc",
|
| 848 |
+
"windows_i686_gnu",
|
| 849 |
+
"windows_i686_gnullvm",
|
| 850 |
+
"windows_i686_msvc",
|
| 851 |
+
"windows_x86_64_gnu",
|
| 852 |
+
"windows_x86_64_gnullvm",
|
| 853 |
+
"windows_x86_64_msvc",
|
| 854 |
+
]
|
| 855 |
+
|
| 856 |
+
[[package]]
|
| 857 |
+
name = "windows_aarch64_gnullvm"
|
| 858 |
+
version = "0.52.6"
|
| 859 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 860 |
+
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
| 861 |
+
|
| 862 |
+
[[package]]
|
| 863 |
+
name = "windows_aarch64_msvc"
|
| 864 |
+
version = "0.52.6"
|
| 865 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 866 |
+
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
| 867 |
+
|
| 868 |
+
[[package]]
|
| 869 |
+
name = "windows_i686_gnu"
|
| 870 |
+
version = "0.52.6"
|
| 871 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 872 |
+
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
| 873 |
+
|
| 874 |
+
[[package]]
|
| 875 |
+
name = "windows_i686_gnullvm"
|
| 876 |
+
version = "0.52.6"
|
| 877 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 878 |
+
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
| 879 |
+
|
| 880 |
+
[[package]]
|
| 881 |
+
name = "windows_i686_msvc"
|
| 882 |
+
version = "0.52.6"
|
| 883 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 884 |
+
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
| 885 |
+
|
| 886 |
+
[[package]]
|
| 887 |
+
name = "windows_x86_64_gnu"
|
| 888 |
+
version = "0.52.6"
|
| 889 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 890 |
+
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
| 891 |
+
|
| 892 |
+
[[package]]
|
| 893 |
+
name = "windows_x86_64_gnullvm"
|
| 894 |
+
version = "0.52.6"
|
| 895 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 896 |
+
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
| 897 |
+
|
| 898 |
+
[[package]]
|
| 899 |
+
name = "windows_x86_64_msvc"
|
| 900 |
+
version = "0.52.6"
|
| 901 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 902 |
+
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
| 903 |
+
|
| 904 |
+
[[package]]
|
| 905 |
+
name = "winnow"
|
| 906 |
+
version = "0.6.13"
|
| 907 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 908 |
+
checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1"
|
| 909 |
+
dependencies = [
|
| 910 |
+
"memchr",
|
| 911 |
+
]
|
| 912 |
+
|
| 913 |
+
[[package]]
|
| 914 |
+
name = "winnow"
|
| 915 |
+
version = "0.7.11"
|
| 916 |
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
| 917 |
+
checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd"
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/Cargo.toml
ADDED
|
@@ -0,0 +1,635 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
| 2 |
+
#
|
| 3 |
+
# When uploading crates to the registry Cargo will automatically
|
| 4 |
+
# "normalize" Cargo.toml files for maximal compatibility
|
| 5 |
+
# with all versions of Cargo and also rewrite `path` dependencies
|
| 6 |
+
# to registry (e.g., crates.io) dependencies.
|
| 7 |
+
#
|
| 8 |
+
# If you are reading this file be aware that the original Cargo.toml
|
| 9 |
+
# will likely look very different (and much more reasonable).
|
| 10 |
+
# See Cargo.toml.orig for the original contents.
|
| 11 |
+
|
| 12 |
+
[package]
|
| 13 |
+
edition = "2021"
|
| 14 |
+
rust-version = "1.74"
|
| 15 |
+
name = "clap"
|
| 16 |
+
version = "4.5.60"
|
| 17 |
+
build = false
|
| 18 |
+
include = [
|
| 19 |
+
"build.rs",
|
| 20 |
+
"src/**/*",
|
| 21 |
+
"Cargo.toml",
|
| 22 |
+
"LICENSE*",
|
| 23 |
+
"README.md",
|
| 24 |
+
"examples/**/*",
|
| 25 |
+
]
|
| 26 |
+
autolib = false
|
| 27 |
+
autobins = false
|
| 28 |
+
autoexamples = false
|
| 29 |
+
autotests = false
|
| 30 |
+
autobenches = false
|
| 31 |
+
description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
|
| 32 |
+
readme = "README.md"
|
| 33 |
+
keywords = [
|
| 34 |
+
"argument",
|
| 35 |
+
"cli",
|
| 36 |
+
"arg",
|
| 37 |
+
"parser",
|
| 38 |
+
"parse",
|
| 39 |
+
]
|
| 40 |
+
categories = ["command-line-interface"]
|
| 41 |
+
license = "MIT OR Apache-2.0"
|
| 42 |
+
repository = "https://github.com/clap-rs/clap"
|
| 43 |
+
|
| 44 |
+
[package.metadata.docs.rs]
|
| 45 |
+
features = ["unstable-doc"]
|
| 46 |
+
rustdoc-args = ["--generate-link-to-definition"]
|
| 47 |
+
|
| 48 |
+
[package.metadata.playground]
|
| 49 |
+
features = ["unstable-doc"]
|
| 50 |
+
|
| 51 |
+
[package.metadata.release]
|
| 52 |
+
shared-version = true
|
| 53 |
+
tag-name = "v{{version}}"
|
| 54 |
+
|
| 55 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 56 |
+
file = "CHANGELOG.md"
|
| 57 |
+
search = "Unreleased"
|
| 58 |
+
replace = "{{version}}"
|
| 59 |
+
min = 1
|
| 60 |
+
|
| 61 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 62 |
+
file = "CHANGELOG.md"
|
| 63 |
+
search = '\.\.\.HEAD'
|
| 64 |
+
replace = "...{{tag_name}}"
|
| 65 |
+
exactly = 1
|
| 66 |
+
|
| 67 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 68 |
+
file = "CHANGELOG.md"
|
| 69 |
+
search = "ReleaseDate"
|
| 70 |
+
replace = "{{date}}"
|
| 71 |
+
min = 1
|
| 72 |
+
|
| 73 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 74 |
+
file = "CHANGELOG.md"
|
| 75 |
+
search = "<!-- next-header -->"
|
| 76 |
+
replace = """
|
| 77 |
+
<!-- next-header -->
|
| 78 |
+
## [Unreleased] - ReleaseDate
|
| 79 |
+
"""
|
| 80 |
+
exactly = 1
|
| 81 |
+
|
| 82 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 83 |
+
file = "CHANGELOG.md"
|
| 84 |
+
search = "<!-- next-url -->"
|
| 85 |
+
replace = """
|
| 86 |
+
<!-- next-url -->
|
| 87 |
+
[Unreleased]: https://github.com/clap-rs/clap/compare/{{tag_name}}...HEAD"""
|
| 88 |
+
exactly = 1
|
| 89 |
+
|
| 90 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 91 |
+
file = "CITATION.cff"
|
| 92 |
+
search = "^date-released: ....-..-.."
|
| 93 |
+
replace = "date-released: {{date}}"
|
| 94 |
+
|
| 95 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 96 |
+
file = "CITATION.cff"
|
| 97 |
+
search = '^version: .+\..+\..+'
|
| 98 |
+
replace = "version: {{version}}"
|
| 99 |
+
|
| 100 |
+
[[package.metadata.release.pre-release-replacements]]
|
| 101 |
+
file = "src/lib.rs"
|
| 102 |
+
search = 'blob/v.+\..+\..+/CHANGELOG.md'
|
| 103 |
+
replace = "blob/v{{version}}/CHANGELOG.md"
|
| 104 |
+
exactly = 1
|
| 105 |
+
|
| 106 |
+
[features]
|
| 107 |
+
cargo = ["clap_builder/cargo"]
|
| 108 |
+
color = ["clap_builder/color"]
|
| 109 |
+
debug = [
|
| 110 |
+
"clap_builder/debug",
|
| 111 |
+
"clap_derive?/debug",
|
| 112 |
+
]
|
| 113 |
+
default = [
|
| 114 |
+
"std",
|
| 115 |
+
"color",
|
| 116 |
+
"help",
|
| 117 |
+
"usage",
|
| 118 |
+
"error-context",
|
| 119 |
+
"suggestions",
|
| 120 |
+
]
|
| 121 |
+
deprecated = [
|
| 122 |
+
"clap_builder/deprecated",
|
| 123 |
+
"clap_derive?/deprecated",
|
| 124 |
+
]
|
| 125 |
+
derive = ["dep:clap_derive"]
|
| 126 |
+
env = ["clap_builder/env"]
|
| 127 |
+
error-context = ["clap_builder/error-context"]
|
| 128 |
+
help = ["clap_builder/help"]
|
| 129 |
+
std = ["clap_builder/std"]
|
| 130 |
+
string = ["clap_builder/string"]
|
| 131 |
+
suggestions = ["clap_builder/suggestions"]
|
| 132 |
+
unicode = ["clap_builder/unicode"]
|
| 133 |
+
unstable-derive-ui-tests = []
|
| 134 |
+
unstable-doc = [
|
| 135 |
+
"clap_builder/unstable-doc",
|
| 136 |
+
"derive",
|
| 137 |
+
]
|
| 138 |
+
unstable-ext = ["clap_builder/unstable-ext"]
|
| 139 |
+
unstable-markdown = ["clap_derive/unstable-markdown"]
|
| 140 |
+
unstable-styles = ["clap_builder/unstable-styles"]
|
| 141 |
+
unstable-v5 = [
|
| 142 |
+
"clap_builder/unstable-v5",
|
| 143 |
+
"clap_derive?/unstable-v5",
|
| 144 |
+
"deprecated",
|
| 145 |
+
]
|
| 146 |
+
usage = ["clap_builder/usage"]
|
| 147 |
+
wrap_help = ["clap_builder/wrap_help"]
|
| 148 |
+
|
| 149 |
+
[lib]
|
| 150 |
+
name = "clap"
|
| 151 |
+
path = "src/lib.rs"
|
| 152 |
+
bench = false
|
| 153 |
+
|
| 154 |
+
[[bin]]
|
| 155 |
+
name = "stdio-fixture"
|
| 156 |
+
path = "src/bin/stdio-fixture.rs"
|
| 157 |
+
|
| 158 |
+
[[example]]
|
| 159 |
+
name = "01_quick"
|
| 160 |
+
path = "examples/tutorial_builder/01_quick.rs"
|
| 161 |
+
doc-scrape-examples = true
|
| 162 |
+
required-features = ["cargo"]
|
| 163 |
+
|
| 164 |
+
[[example]]
|
| 165 |
+
name = "01_quick_derive"
|
| 166 |
+
path = "examples/tutorial_derive/01_quick.rs"
|
| 167 |
+
doc-scrape-examples = true
|
| 168 |
+
required-features = ["derive"]
|
| 169 |
+
|
| 170 |
+
[[example]]
|
| 171 |
+
name = "02_app_settings"
|
| 172 |
+
path = "examples/tutorial_builder/02_app_settings.rs"
|
| 173 |
+
doc-scrape-examples = true
|
| 174 |
+
required-features = ["cargo"]
|
| 175 |
+
|
| 176 |
+
[[example]]
|
| 177 |
+
name = "02_app_settings_derive"
|
| 178 |
+
path = "examples/tutorial_derive/02_app_settings.rs"
|
| 179 |
+
doc-scrape-examples = true
|
| 180 |
+
required-features = ["derive"]
|
| 181 |
+
|
| 182 |
+
[[example]]
|
| 183 |
+
name = "02_apps"
|
| 184 |
+
path = "examples/tutorial_builder/02_apps.rs"
|
| 185 |
+
doc-scrape-examples = true
|
| 186 |
+
|
| 187 |
+
[[example]]
|
| 188 |
+
name = "02_apps_derive"
|
| 189 |
+
path = "examples/tutorial_derive/02_apps.rs"
|
| 190 |
+
doc-scrape-examples = true
|
| 191 |
+
required-features = ["derive"]
|
| 192 |
+
|
| 193 |
+
[[example]]
|
| 194 |
+
name = "02_crate"
|
| 195 |
+
path = "examples/tutorial_builder/02_crate.rs"
|
| 196 |
+
doc-scrape-examples = true
|
| 197 |
+
required-features = ["cargo"]
|
| 198 |
+
|
| 199 |
+
[[example]]
|
| 200 |
+
name = "02_crate_derive"
|
| 201 |
+
path = "examples/tutorial_derive/02_crate.rs"
|
| 202 |
+
doc-scrape-examples = true
|
| 203 |
+
required-features = ["derive"]
|
| 204 |
+
|
| 205 |
+
[[example]]
|
| 206 |
+
name = "03_01_flag_bool"
|
| 207 |
+
path = "examples/tutorial_builder/03_01_flag_bool.rs"
|
| 208 |
+
doc-scrape-examples = true
|
| 209 |
+
required-features = ["cargo"]
|
| 210 |
+
|
| 211 |
+
[[example]]
|
| 212 |
+
name = "03_01_flag_bool_derive"
|
| 213 |
+
path = "examples/tutorial_derive/03_01_flag_bool.rs"
|
| 214 |
+
doc-scrape-examples = true
|
| 215 |
+
required-features = ["derive"]
|
| 216 |
+
|
| 217 |
+
[[example]]
|
| 218 |
+
name = "03_01_flag_count"
|
| 219 |
+
path = "examples/tutorial_builder/03_01_flag_count.rs"
|
| 220 |
+
doc-scrape-examples = true
|
| 221 |
+
required-features = ["cargo"]
|
| 222 |
+
|
| 223 |
+
[[example]]
|
| 224 |
+
name = "03_01_flag_count_derive"
|
| 225 |
+
path = "examples/tutorial_derive/03_01_flag_count.rs"
|
| 226 |
+
doc-scrape-examples = true
|
| 227 |
+
required-features = ["derive"]
|
| 228 |
+
|
| 229 |
+
[[example]]
|
| 230 |
+
name = "03_02_option"
|
| 231 |
+
path = "examples/tutorial_builder/03_02_option.rs"
|
| 232 |
+
doc-scrape-examples = true
|
| 233 |
+
required-features = ["cargo"]
|
| 234 |
+
|
| 235 |
+
[[example]]
|
| 236 |
+
name = "03_02_option_derive"
|
| 237 |
+
path = "examples/tutorial_derive/03_02_option.rs"
|
| 238 |
+
doc-scrape-examples = true
|
| 239 |
+
required-features = ["derive"]
|
| 240 |
+
|
| 241 |
+
[[example]]
|
| 242 |
+
name = "03_02_option_mult"
|
| 243 |
+
path = "examples/tutorial_builder/03_02_option_mult.rs"
|
| 244 |
+
doc-scrape-examples = true
|
| 245 |
+
required-features = ["cargo"]
|
| 246 |
+
|
| 247 |
+
[[example]]
|
| 248 |
+
name = "03_02_option_mult_derive"
|
| 249 |
+
path = "examples/tutorial_derive/03_02_option_mult.rs"
|
| 250 |
+
doc-scrape-examples = true
|
| 251 |
+
required-features = ["derive"]
|
| 252 |
+
|
| 253 |
+
[[example]]
|
| 254 |
+
name = "03_03_positional"
|
| 255 |
+
path = "examples/tutorial_builder/03_03_positional.rs"
|
| 256 |
+
doc-scrape-examples = true
|
| 257 |
+
required-features = ["cargo"]
|
| 258 |
+
|
| 259 |
+
[[example]]
|
| 260 |
+
name = "03_03_positional_derive"
|
| 261 |
+
path = "examples/tutorial_derive/03_03_positional.rs"
|
| 262 |
+
doc-scrape-examples = true
|
| 263 |
+
required-features = ["derive"]
|
| 264 |
+
|
| 265 |
+
[[example]]
|
| 266 |
+
name = "03_03_positional_mult"
|
| 267 |
+
path = "examples/tutorial_builder/03_03_positional_mult.rs"
|
| 268 |
+
doc-scrape-examples = true
|
| 269 |
+
required-features = ["cargo"]
|
| 270 |
+
|
| 271 |
+
[[example]]
|
| 272 |
+
name = "03_03_positional_mult_derive"
|
| 273 |
+
path = "examples/tutorial_derive/03_03_positional_mult.rs"
|
| 274 |
+
doc-scrape-examples = true
|
| 275 |
+
required-features = ["derive"]
|
| 276 |
+
|
| 277 |
+
[[example]]
|
| 278 |
+
name = "03_04_subcommands"
|
| 279 |
+
path = "examples/tutorial_builder/03_04_subcommands.rs"
|
| 280 |
+
doc-scrape-examples = true
|
| 281 |
+
required-features = ["cargo"]
|
| 282 |
+
|
| 283 |
+
[[example]]
|
| 284 |
+
name = "03_04_subcommands_alt_derive"
|
| 285 |
+
path = "examples/tutorial_derive/03_04_subcommands_alt.rs"
|
| 286 |
+
doc-scrape-examples = true
|
| 287 |
+
required-features = ["derive"]
|
| 288 |
+
|
| 289 |
+
[[example]]
|
| 290 |
+
name = "03_04_subcommands_derive"
|
| 291 |
+
path = "examples/tutorial_derive/03_04_subcommands.rs"
|
| 292 |
+
doc-scrape-examples = true
|
| 293 |
+
required-features = ["derive"]
|
| 294 |
+
|
| 295 |
+
[[example]]
|
| 296 |
+
name = "03_05_default_values"
|
| 297 |
+
path = "examples/tutorial_builder/03_05_default_values.rs"
|
| 298 |
+
doc-scrape-examples = true
|
| 299 |
+
required-features = ["cargo"]
|
| 300 |
+
|
| 301 |
+
[[example]]
|
| 302 |
+
name = "03_05_default_values_derive"
|
| 303 |
+
path = "examples/tutorial_derive/03_05_default_values.rs"
|
| 304 |
+
doc-scrape-examples = true
|
| 305 |
+
required-features = ["derive"]
|
| 306 |
+
|
| 307 |
+
[[example]]
|
| 308 |
+
name = "03_06_optional_derive"
|
| 309 |
+
path = "examples/tutorial_derive/03_06_optional.rs"
|
| 310 |
+
doc-scrape-examples = true
|
| 311 |
+
required-features = ["derive"]
|
| 312 |
+
|
| 313 |
+
[[example]]
|
| 314 |
+
name = "03_06_required"
|
| 315 |
+
path = "examples/tutorial_builder/03_06_required.rs"
|
| 316 |
+
doc-scrape-examples = true
|
| 317 |
+
required-features = ["cargo"]
|
| 318 |
+
|
| 319 |
+
[[example]]
|
| 320 |
+
name = "04_01_enum"
|
| 321 |
+
path = "examples/tutorial_builder/04_01_enum.rs"
|
| 322 |
+
doc-scrape-examples = true
|
| 323 |
+
required-features = ["cargo"]
|
| 324 |
+
|
| 325 |
+
[[example]]
|
| 326 |
+
name = "04_01_enum_derive"
|
| 327 |
+
path = "examples/tutorial_derive/04_01_enum.rs"
|
| 328 |
+
doc-scrape-examples = true
|
| 329 |
+
required-features = ["derive"]
|
| 330 |
+
|
| 331 |
+
[[example]]
|
| 332 |
+
name = "04_01_possible"
|
| 333 |
+
path = "examples/tutorial_builder/04_01_possible.rs"
|
| 334 |
+
doc-scrape-examples = true
|
| 335 |
+
required-features = ["cargo"]
|
| 336 |
+
|
| 337 |
+
[[example]]
|
| 338 |
+
name = "04_02_parse"
|
| 339 |
+
path = "examples/tutorial_builder/04_02_parse.rs"
|
| 340 |
+
doc-scrape-examples = true
|
| 341 |
+
required-features = ["cargo"]
|
| 342 |
+
|
| 343 |
+
[[example]]
|
| 344 |
+
name = "04_02_parse_derive"
|
| 345 |
+
path = "examples/tutorial_derive/04_02_parse.rs"
|
| 346 |
+
doc-scrape-examples = true
|
| 347 |
+
required-features = ["derive"]
|
| 348 |
+
|
| 349 |
+
[[example]]
|
| 350 |
+
name = "04_02_validate"
|
| 351 |
+
path = "examples/tutorial_builder/04_02_validate.rs"
|
| 352 |
+
doc-scrape-examples = true
|
| 353 |
+
required-features = ["cargo"]
|
| 354 |
+
|
| 355 |
+
[[example]]
|
| 356 |
+
name = "04_02_validate_derive"
|
| 357 |
+
path = "examples/tutorial_derive/04_02_validate.rs"
|
| 358 |
+
doc-scrape-examples = true
|
| 359 |
+
required-features = ["derive"]
|
| 360 |
+
|
| 361 |
+
[[example]]
|
| 362 |
+
name = "04_03_relations"
|
| 363 |
+
path = "examples/tutorial_builder/04_03_relations.rs"
|
| 364 |
+
doc-scrape-examples = true
|
| 365 |
+
required-features = ["cargo"]
|
| 366 |
+
|
| 367 |
+
[[example]]
|
| 368 |
+
name = "04_03_relations_derive"
|
| 369 |
+
path = "examples/tutorial_derive/04_03_relations.rs"
|
| 370 |
+
doc-scrape-examples = true
|
| 371 |
+
required-features = ["derive"]
|
| 372 |
+
|
| 373 |
+
[[example]]
|
| 374 |
+
name = "04_04_custom"
|
| 375 |
+
path = "examples/tutorial_builder/04_04_custom.rs"
|
| 376 |
+
doc-scrape-examples = true
|
| 377 |
+
required-features = ["cargo"]
|
| 378 |
+
|
| 379 |
+
[[example]]
|
| 380 |
+
name = "04_04_custom_derive"
|
| 381 |
+
path = "examples/tutorial_derive/04_04_custom.rs"
|
| 382 |
+
doc-scrape-examples = true
|
| 383 |
+
required-features = ["derive"]
|
| 384 |
+
|
| 385 |
+
[[example]]
|
| 386 |
+
name = "05_01_assert"
|
| 387 |
+
path = "examples/tutorial_builder/05_01_assert.rs"
|
| 388 |
+
test = true
|
| 389 |
+
doc-scrape-examples = true
|
| 390 |
+
required-features = ["cargo"]
|
| 391 |
+
|
| 392 |
+
[[example]]
|
| 393 |
+
name = "05_01_assert_derive"
|
| 394 |
+
path = "examples/tutorial_derive/05_01_assert.rs"
|
| 395 |
+
test = true
|
| 396 |
+
doc-scrape-examples = true
|
| 397 |
+
required-features = ["derive"]
|
| 398 |
+
|
| 399 |
+
[[example]]
|
| 400 |
+
name = "busybox"
|
| 401 |
+
path = "examples/multicall-busybox.rs"
|
| 402 |
+
doc-scrape-examples = true
|
| 403 |
+
|
| 404 |
+
[[example]]
|
| 405 |
+
name = "cargo-example"
|
| 406 |
+
path = "examples/cargo-example.rs"
|
| 407 |
+
doc-scrape-examples = true
|
| 408 |
+
required-features = [
|
| 409 |
+
"cargo",
|
| 410 |
+
"color",
|
| 411 |
+
]
|
| 412 |
+
|
| 413 |
+
[[example]]
|
| 414 |
+
name = "cargo-example-derive"
|
| 415 |
+
path = "examples/cargo-example-derive.rs"
|
| 416 |
+
doc-scrape-examples = true
|
| 417 |
+
required-features = [
|
| 418 |
+
"derive",
|
| 419 |
+
"color",
|
| 420 |
+
]
|
| 421 |
+
|
| 422 |
+
[[example]]
|
| 423 |
+
name = "demo"
|
| 424 |
+
path = "examples/demo.rs"
|
| 425 |
+
doc-scrape-examples = true
|
| 426 |
+
required-features = ["derive"]
|
| 427 |
+
|
| 428 |
+
[[example]]
|
| 429 |
+
name = "escaped-positional"
|
| 430 |
+
path = "examples/escaped-positional.rs"
|
| 431 |
+
doc-scrape-examples = true
|
| 432 |
+
required-features = ["cargo"]
|
| 433 |
+
|
| 434 |
+
[[example]]
|
| 435 |
+
name = "escaped-positional-derive"
|
| 436 |
+
path = "examples/escaped-positional-derive.rs"
|
| 437 |
+
doc-scrape-examples = true
|
| 438 |
+
required-features = ["derive"]
|
| 439 |
+
|
| 440 |
+
[[example]]
|
| 441 |
+
name = "find"
|
| 442 |
+
path = "examples/find.rs"
|
| 443 |
+
doc-scrape-examples = true
|
| 444 |
+
required-features = ["cargo"]
|
| 445 |
+
|
| 446 |
+
[[example]]
|
| 447 |
+
name = "git"
|
| 448 |
+
path = "examples/git.rs"
|
| 449 |
+
|
| 450 |
+
[[example]]
|
| 451 |
+
name = "git-derive"
|
| 452 |
+
path = "examples/git-derive.rs"
|
| 453 |
+
doc-scrape-examples = true
|
| 454 |
+
required-features = ["derive"]
|
| 455 |
+
|
| 456 |
+
[[example]]
|
| 457 |
+
name = "hostname"
|
| 458 |
+
path = "examples/multicall-hostname.rs"
|
| 459 |
+
doc-scrape-examples = true
|
| 460 |
+
|
| 461 |
+
[[example]]
|
| 462 |
+
name = "interop_augment_args"
|
| 463 |
+
path = "examples/derive_ref/augment_args.rs"
|
| 464 |
+
doc-scrape-examples = true
|
| 465 |
+
required-features = ["derive"]
|
| 466 |
+
|
| 467 |
+
[[example]]
|
| 468 |
+
name = "interop_augment_subcommands"
|
| 469 |
+
path = "examples/derive_ref/augment_subcommands.rs"
|
| 470 |
+
doc-scrape-examples = true
|
| 471 |
+
required-features = ["derive"]
|
| 472 |
+
|
| 473 |
+
[[example]]
|
| 474 |
+
name = "interop_flatten_hand_args"
|
| 475 |
+
path = "examples/derive_ref/flatten_hand_args.rs"
|
| 476 |
+
doc-scrape-examples = true
|
| 477 |
+
required-features = ["derive"]
|
| 478 |
+
|
| 479 |
+
[[example]]
|
| 480 |
+
name = "interop_hand_subcommand"
|
| 481 |
+
path = "examples/derive_ref/hand_subcommand.rs"
|
| 482 |
+
doc-scrape-examples = true
|
| 483 |
+
required-features = ["derive"]
|
| 484 |
+
|
| 485 |
+
[[example]]
|
| 486 |
+
name = "pacman"
|
| 487 |
+
path = "examples/pacman.rs"
|
| 488 |
+
|
| 489 |
+
[[example]]
|
| 490 |
+
name = "repl"
|
| 491 |
+
path = "examples/repl.rs"
|
| 492 |
+
doc-scrape-examples = true
|
| 493 |
+
required-features = ["help"]
|
| 494 |
+
|
| 495 |
+
[[example]]
|
| 496 |
+
name = "repl-derive"
|
| 497 |
+
path = "examples/repl-derive.rs"
|
| 498 |
+
doc-scrape-examples = true
|
| 499 |
+
required-features = ["derive"]
|
| 500 |
+
|
| 501 |
+
[[example]]
|
| 502 |
+
name = "typed-derive"
|
| 503 |
+
path = "examples/typed-derive/main.rs"
|
| 504 |
+
doc-scrape-examples = true
|
| 505 |
+
required-features = ["derive"]
|
| 506 |
+
|
| 507 |
+
[dependencies.clap_builder]
|
| 508 |
+
version = "=4.5.60"
|
| 509 |
+
default-features = false
|
| 510 |
+
|
| 511 |
+
[dependencies.clap_derive]
|
| 512 |
+
version = "=4.5.55"
|
| 513 |
+
optional = true
|
| 514 |
+
|
| 515 |
+
[dev-dependencies.automod]
|
| 516 |
+
version = "1.0.14"
|
| 517 |
+
|
| 518 |
+
[dev-dependencies.clap-cargo]
|
| 519 |
+
version = "0.15.0"
|
| 520 |
+
default-features = false
|
| 521 |
+
|
| 522 |
+
[dev-dependencies.jiff]
|
| 523 |
+
version = "0.2.3"
|
| 524 |
+
|
| 525 |
+
[dev-dependencies.rustversion]
|
| 526 |
+
version = "1.0.15"
|
| 527 |
+
|
| 528 |
+
[dev-dependencies.semver]
|
| 529 |
+
version = "1.0.26"
|
| 530 |
+
|
| 531 |
+
[dev-dependencies.shlex]
|
| 532 |
+
version = "1.3.0"
|
| 533 |
+
|
| 534 |
+
[dev-dependencies.snapbox]
|
| 535 |
+
version = "0.6.16"
|
| 536 |
+
features = ["term-svg"]
|
| 537 |
+
|
| 538 |
+
[dev-dependencies.trybuild]
|
| 539 |
+
version = "1.0.91"
|
| 540 |
+
|
| 541 |
+
[dev-dependencies.trycmd]
|
| 542 |
+
version = "0.15.3"
|
| 543 |
+
features = [
|
| 544 |
+
"color-auto",
|
| 545 |
+
"diff",
|
| 546 |
+
"examples",
|
| 547 |
+
]
|
| 548 |
+
default-features = false
|
| 549 |
+
|
| 550 |
+
[lints.clippy]
|
| 551 |
+
assigning_clones = "allow"
|
| 552 |
+
blocks_in_conditions = "allow"
|
| 553 |
+
bool_assert_comparison = "allow"
|
| 554 |
+
branches_sharing_code = "allow"
|
| 555 |
+
checked_conversions = "warn"
|
| 556 |
+
collapsible_else_if = "allow"
|
| 557 |
+
create_dir = "warn"
|
| 558 |
+
dbg_macro = "warn"
|
| 559 |
+
debug_assert_with_mut_call = "warn"
|
| 560 |
+
doc_markdown = "warn"
|
| 561 |
+
empty_enums = "warn"
|
| 562 |
+
enum_glob_use = "warn"
|
| 563 |
+
expl_impl_clone_on_copy = "warn"
|
| 564 |
+
explicit_deref_methods = "warn"
|
| 565 |
+
explicit_into_iter_loop = "warn"
|
| 566 |
+
fallible_impl_from = "warn"
|
| 567 |
+
filter_map_next = "warn"
|
| 568 |
+
flat_map_option = "warn"
|
| 569 |
+
float_cmp_const = "warn"
|
| 570 |
+
fn_params_excessive_bools = "warn"
|
| 571 |
+
from_iter_instead_of_collect = "warn"
|
| 572 |
+
if_same_then_else = "allow"
|
| 573 |
+
implicit_clone = "warn"
|
| 574 |
+
imprecise_flops = "warn"
|
| 575 |
+
inconsistent_struct_constructor = "warn"
|
| 576 |
+
inefficient_to_string = "warn"
|
| 577 |
+
infinite_loop = "warn"
|
| 578 |
+
invalid_upcast_comparisons = "warn"
|
| 579 |
+
large_digit_groups = "warn"
|
| 580 |
+
large_stack_arrays = "warn"
|
| 581 |
+
large_types_passed_by_value = "warn"
|
| 582 |
+
let_and_return = "allow"
|
| 583 |
+
linkedlist = "warn"
|
| 584 |
+
lossy_float_literal = "warn"
|
| 585 |
+
macro_use_imports = "warn"
|
| 586 |
+
mem_forget = "warn"
|
| 587 |
+
multiple_bound_locations = "allow"
|
| 588 |
+
mutex_integer = "warn"
|
| 589 |
+
needless_continue = "allow"
|
| 590 |
+
needless_for_each = "warn"
|
| 591 |
+
negative_feature_names = "warn"
|
| 592 |
+
path_buf_push_overwrite = "warn"
|
| 593 |
+
ptr_as_ptr = "warn"
|
| 594 |
+
rc_mutex = "warn"
|
| 595 |
+
redundant_feature_names = "warn"
|
| 596 |
+
ref_option_ref = "warn"
|
| 597 |
+
rest_pat_in_fully_bound_structs = "warn"
|
| 598 |
+
result_large_err = "allow"
|
| 599 |
+
same_functions_in_if_condition = "warn"
|
| 600 |
+
self_named_module_files = "warn"
|
| 601 |
+
semicolon_if_nothing_returned = "warn"
|
| 602 |
+
string_add_assign = "warn"
|
| 603 |
+
string_lit_as_bytes = "warn"
|
| 604 |
+
todo = "warn"
|
| 605 |
+
trait_duplication_in_bounds = "warn"
|
| 606 |
+
uninlined_format_args = "warn"
|
| 607 |
+
verbose_file_reads = "warn"
|
| 608 |
+
zero_sized_map_values = "warn"
|
| 609 |
+
|
| 610 |
+
[lints.rust]
|
| 611 |
+
unnameable_types = "allow"
|
| 612 |
+
unreachable_pub = "warn"
|
| 613 |
+
unsafe_op_in_unsafe_fn = "warn"
|
| 614 |
+
unused_lifetimes = "warn"
|
| 615 |
+
unused_macro_rules = "warn"
|
| 616 |
+
unused_qualifications = "warn"
|
| 617 |
+
|
| 618 |
+
[lints.rust.rust_2018_idioms]
|
| 619 |
+
level = "warn"
|
| 620 |
+
priority = -1
|
| 621 |
+
|
| 622 |
+
[profile.bench]
|
| 623 |
+
lto = true
|
| 624 |
+
codegen-units = 1
|
| 625 |
+
|
| 626 |
+
[profile.dev]
|
| 627 |
+
panic = "abort"
|
| 628 |
+
|
| 629 |
+
[profile.release]
|
| 630 |
+
lto = true
|
| 631 |
+
codegen-units = 1
|
| 632 |
+
panic = "abort"
|
| 633 |
+
|
| 634 |
+
[profile.test]
|
| 635 |
+
opt-level = 1
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/Cargo.toml.orig
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[workspace]
|
| 2 |
+
resolver = "2"
|
| 3 |
+
members = [
|
| 4 |
+
"clap_bench",
|
| 5 |
+
"clap_builder",
|
| 6 |
+
"clap_derive",
|
| 7 |
+
"clap_lex",
|
| 8 |
+
"clap_complete",
|
| 9 |
+
"clap_complete_nushell",
|
| 10 |
+
"clap_mangen",
|
| 11 |
+
]
|
| 12 |
+
|
| 13 |
+
[workspace.package]
|
| 14 |
+
repository = "https://github.com/clap-rs/clap"
|
| 15 |
+
license = "MIT OR Apache-2.0"
|
| 16 |
+
edition = "2021"
|
| 17 |
+
rust-version = "1.74" # MSRV
|
| 18 |
+
include = [
|
| 19 |
+
"build.rs",
|
| 20 |
+
"src/**/*",
|
| 21 |
+
"Cargo.toml",
|
| 22 |
+
"LICENSE*",
|
| 23 |
+
"README.md",
|
| 24 |
+
"examples/**/*"
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
[workspace.lints.rust]
|
| 28 |
+
rust_2018_idioms = { level = "warn", priority = -1 }
|
| 29 |
+
unnameable_types = "allow"
|
| 30 |
+
unreachable_pub = "warn"
|
| 31 |
+
unsafe_op_in_unsafe_fn = "warn"
|
| 32 |
+
unused_lifetimes = "warn"
|
| 33 |
+
unused_macro_rules = "warn"
|
| 34 |
+
unused_qualifications = "warn"
|
| 35 |
+
|
| 36 |
+
[workspace.lints.clippy]
|
| 37 |
+
bool_assert_comparison = "allow"
|
| 38 |
+
branches_sharing_code = "allow"
|
| 39 |
+
checked_conversions = "warn"
|
| 40 |
+
collapsible_else_if = "allow"
|
| 41 |
+
create_dir = "warn"
|
| 42 |
+
dbg_macro = "warn"
|
| 43 |
+
debug_assert_with_mut_call = "warn"
|
| 44 |
+
doc_markdown = "warn"
|
| 45 |
+
empty_enums = "warn"
|
| 46 |
+
enum_glob_use = "warn"
|
| 47 |
+
expl_impl_clone_on_copy = "warn"
|
| 48 |
+
explicit_deref_methods = "warn"
|
| 49 |
+
explicit_into_iter_loop = "warn"
|
| 50 |
+
fallible_impl_from = "warn"
|
| 51 |
+
filter_map_next = "warn"
|
| 52 |
+
flat_map_option = "warn"
|
| 53 |
+
float_cmp_const = "warn"
|
| 54 |
+
fn_params_excessive_bools = "warn"
|
| 55 |
+
from_iter_instead_of_collect = "warn"
|
| 56 |
+
if_same_then_else = "allow"
|
| 57 |
+
implicit_clone = "warn"
|
| 58 |
+
imprecise_flops = "warn"
|
| 59 |
+
inconsistent_struct_constructor = "warn"
|
| 60 |
+
inefficient_to_string = "warn"
|
| 61 |
+
infinite_loop = "warn"
|
| 62 |
+
invalid_upcast_comparisons = "warn"
|
| 63 |
+
large_digit_groups = "warn"
|
| 64 |
+
large_stack_arrays = "warn"
|
| 65 |
+
large_types_passed_by_value = "warn"
|
| 66 |
+
let_and_return = "allow" # sometimes good to name what you are returning
|
| 67 |
+
linkedlist = "warn"
|
| 68 |
+
lossy_float_literal = "warn"
|
| 69 |
+
macro_use_imports = "warn"
|
| 70 |
+
mem_forget = "warn"
|
| 71 |
+
mutex_integer = "warn"
|
| 72 |
+
needless_continue = "allow"
|
| 73 |
+
needless_for_each = "warn"
|
| 74 |
+
negative_feature_names = "warn"
|
| 75 |
+
path_buf_push_overwrite = "warn"
|
| 76 |
+
ptr_as_ptr = "warn"
|
| 77 |
+
rc_mutex = "warn"
|
| 78 |
+
redundant_feature_names = "warn"
|
| 79 |
+
ref_option_ref = "warn"
|
| 80 |
+
rest_pat_in_fully_bound_structs = "warn"
|
| 81 |
+
result_large_err = "allow"
|
| 82 |
+
same_functions_in_if_condition = "warn"
|
| 83 |
+
self_named_module_files = "warn"
|
| 84 |
+
semicolon_if_nothing_returned = "warn"
|
| 85 |
+
# str_to_string = "warn"
|
| 86 |
+
# string_add = "warn"
|
| 87 |
+
string_add_assign = "warn"
|
| 88 |
+
string_lit_as_bytes = "warn"
|
| 89 |
+
todo = "warn"
|
| 90 |
+
trait_duplication_in_bounds = "warn"
|
| 91 |
+
uninlined_format_args = "warn"
|
| 92 |
+
verbose_file_reads = "warn"
|
| 93 |
+
# wildcard_imports = "warn"
|
| 94 |
+
zero_sized_map_values = "warn"
|
| 95 |
+
# Fix later:
|
| 96 |
+
multiple_bound_locations = "allow"
|
| 97 |
+
assigning_clones = "allow"
|
| 98 |
+
blocks_in_conditions = "allow"
|
| 99 |
+
|
| 100 |
+
[profile.dev]
|
| 101 |
+
panic = "abort"
|
| 102 |
+
|
| 103 |
+
[profile.release]
|
| 104 |
+
panic = "abort"
|
| 105 |
+
codegen-units = 1
|
| 106 |
+
lto = true
|
| 107 |
+
# debug = "line-tables-only" # requires Cargo 1.71
|
| 108 |
+
|
| 109 |
+
[package]
|
| 110 |
+
name = "clap"
|
| 111 |
+
version = "4.5.60"
|
| 112 |
+
description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
|
| 113 |
+
categories = ["command-line-interface"]
|
| 114 |
+
keywords = [
|
| 115 |
+
"argument",
|
| 116 |
+
"cli",
|
| 117 |
+
"arg",
|
| 118 |
+
"parser",
|
| 119 |
+
"parse"
|
| 120 |
+
]
|
| 121 |
+
repository.workspace = true
|
| 122 |
+
license.workspace = true
|
| 123 |
+
edition.workspace = true
|
| 124 |
+
rust-version.workspace = true
|
| 125 |
+
include.workspace = true
|
| 126 |
+
|
| 127 |
+
[package.metadata.docs.rs]
|
| 128 |
+
features = ["unstable-doc"]
|
| 129 |
+
rustdoc-args = ["--generate-link-to-definition"]
|
| 130 |
+
|
| 131 |
+
[package.metadata.playground]
|
| 132 |
+
features = ["unstable-doc"]
|
| 133 |
+
|
| 134 |
+
[package.metadata.release]
|
| 135 |
+
shared-version = true
|
| 136 |
+
tag-name = "v{{version}}"
|
| 137 |
+
pre-release-replacements = [
|
| 138 |
+
{file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1},
|
| 139 |
+
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
|
| 140 |
+
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
|
| 141 |
+
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
|
| 142 |
+
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/clap-rs/clap/compare/{{tag_name}}...HEAD", exactly=1},
|
| 143 |
+
{file="CITATION.cff", search="^date-released: ....-..-..", replace="date-released: {{date}}"},
|
| 144 |
+
{file="CITATION.cff", search="^version: .+\\..+\\..+", replace="version: {{version}}"},
|
| 145 |
+
{file="src/lib.rs", search="blob/v.+\\..+\\..+/CHANGELOG.md", replace="blob/v{{version}}/CHANGELOG.md", exactly=1},
|
| 146 |
+
]
|
| 147 |
+
|
| 148 |
+
[features]
|
| 149 |
+
default = [
|
| 150 |
+
"std",
|
| 151 |
+
"color",
|
| 152 |
+
"help",
|
| 153 |
+
"usage",
|
| 154 |
+
"error-context",
|
| 155 |
+
"suggestions",
|
| 156 |
+
]
|
| 157 |
+
debug = ["clap_builder/debug", "clap_derive?/debug"] # Enables debug messages
|
| 158 |
+
unstable-doc = ["clap_builder/unstable-doc", "derive"] # for docs.rs
|
| 159 |
+
|
| 160 |
+
# Used in default
|
| 161 |
+
std = ["clap_builder/std"] # support for no_std in a backwards-compatible way
|
| 162 |
+
color = ["clap_builder/color"]
|
| 163 |
+
help = ["clap_builder/help"]
|
| 164 |
+
usage = ["clap_builder/usage"]
|
| 165 |
+
error-context = ["clap_builder/error-context"]
|
| 166 |
+
suggestions = ["clap_builder/suggestions"]
|
| 167 |
+
|
| 168 |
+
# Optional
|
| 169 |
+
deprecated = ["clap_builder/deprecated", "clap_derive?/deprecated"] # Guided experience to prepare for next breaking release (at different stages of development, this may become default)
|
| 170 |
+
derive = ["dep:clap_derive"]
|
| 171 |
+
cargo = ["clap_builder/cargo"] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros
|
| 172 |
+
wrap_help = ["clap_builder/wrap_help"]
|
| 173 |
+
env = ["clap_builder/env"] # Use environment variables during arg parsing
|
| 174 |
+
unicode = ["clap_builder/unicode"] # Support for unicode characters in arguments and help messages
|
| 175 |
+
string = ["clap_builder/string"] # Allow runtime generated strings
|
| 176 |
+
|
| 177 |
+
# In-work features
|
| 178 |
+
unstable-v5 = ["clap_builder/unstable-v5", "clap_derive?/unstable-v5", "deprecated"]
|
| 179 |
+
unstable-ext = ["clap_builder/unstable-ext"]
|
| 180 |
+
unstable-styles = ["clap_builder/unstable-styles"] # deprecated
|
| 181 |
+
unstable-derive-ui-tests = []
|
| 182 |
+
unstable-markdown = ["clap_derive/unstable-markdown"]
|
| 183 |
+
|
| 184 |
+
[lib]
|
| 185 |
+
bench = false
|
| 186 |
+
|
| 187 |
+
[dependencies]
|
| 188 |
+
clap_builder = { path = "./clap_builder", version = "=4.5.60", default-features = false }
|
| 189 |
+
clap_derive = { path = "./clap_derive", version = "=4.5.55", optional = true }
|
| 190 |
+
|
| 191 |
+
[dev-dependencies]
|
| 192 |
+
trybuild = "1.0.91"
|
| 193 |
+
rustversion = "1.0.15"
|
| 194 |
+
# Cutting out `filesystem` feature
|
| 195 |
+
trycmd = { version = "0.15.3", default-features = false, features = ["color-auto", "diff", "examples"] }
|
| 196 |
+
jiff = "0.2.3"
|
| 197 |
+
snapbox = { version = "0.6.16", features = ["term-svg"] }
|
| 198 |
+
shlex = "1.3.0"
|
| 199 |
+
automod = "1.0.14"
|
| 200 |
+
clap-cargo = { version = "0.15.0", default-features = false }
|
| 201 |
+
semver = "1.0.26"
|
| 202 |
+
|
| 203 |
+
[[example]]
|
| 204 |
+
name = "demo"
|
| 205 |
+
required-features = ["derive"]
|
| 206 |
+
doc-scrape-examples = true
|
| 207 |
+
|
| 208 |
+
[[example]]
|
| 209 |
+
name = "cargo-example"
|
| 210 |
+
required-features = ["cargo", "color"]
|
| 211 |
+
doc-scrape-examples = true
|
| 212 |
+
|
| 213 |
+
[[example]]
|
| 214 |
+
name = "cargo-example-derive"
|
| 215 |
+
required-features = ["derive", "color"]
|
| 216 |
+
doc-scrape-examples = true
|
| 217 |
+
|
| 218 |
+
[[example]]
|
| 219 |
+
name = "escaped-positional"
|
| 220 |
+
required-features = ["cargo"]
|
| 221 |
+
doc-scrape-examples = true
|
| 222 |
+
|
| 223 |
+
[[example]]
|
| 224 |
+
name = "escaped-positional-derive"
|
| 225 |
+
required-features = ["derive"]
|
| 226 |
+
doc-scrape-examples = true
|
| 227 |
+
|
| 228 |
+
[[example]]
|
| 229 |
+
name = "find"
|
| 230 |
+
required-features = ["cargo"]
|
| 231 |
+
doc-scrape-examples = true
|
| 232 |
+
|
| 233 |
+
[[example]]
|
| 234 |
+
name = "git-derive"
|
| 235 |
+
required-features = ["derive"]
|
| 236 |
+
doc-scrape-examples = true
|
| 237 |
+
|
| 238 |
+
[[example]]
|
| 239 |
+
name = "typed-derive"
|
| 240 |
+
required-features = ["derive"]
|
| 241 |
+
doc-scrape-examples = true
|
| 242 |
+
|
| 243 |
+
[[example]]
|
| 244 |
+
name = "busybox"
|
| 245 |
+
path = "examples/multicall-busybox.rs"
|
| 246 |
+
doc-scrape-examples = true
|
| 247 |
+
|
| 248 |
+
[[example]]
|
| 249 |
+
name = "hostname"
|
| 250 |
+
path = "examples/multicall-hostname.rs"
|
| 251 |
+
doc-scrape-examples = true
|
| 252 |
+
|
| 253 |
+
[[example]]
|
| 254 |
+
name = "repl"
|
| 255 |
+
path = "examples/repl.rs"
|
| 256 |
+
required-features = ["help"]
|
| 257 |
+
doc-scrape-examples = true
|
| 258 |
+
|
| 259 |
+
[[example]]
|
| 260 |
+
name = "repl-derive"
|
| 261 |
+
path = "examples/repl-derive.rs"
|
| 262 |
+
required-features = ["derive"]
|
| 263 |
+
doc-scrape-examples = true
|
| 264 |
+
|
| 265 |
+
[[example]]
|
| 266 |
+
name = "01_quick"
|
| 267 |
+
path = "examples/tutorial_builder/01_quick.rs"
|
| 268 |
+
required-features = ["cargo"]
|
| 269 |
+
doc-scrape-examples = true
|
| 270 |
+
|
| 271 |
+
[[example]]
|
| 272 |
+
name = "02_apps"
|
| 273 |
+
path = "examples/tutorial_builder/02_apps.rs"
|
| 274 |
+
doc-scrape-examples = true
|
| 275 |
+
|
| 276 |
+
[[example]]
|
| 277 |
+
name = "02_crate"
|
| 278 |
+
path = "examples/tutorial_builder/02_crate.rs"
|
| 279 |
+
required-features = ["cargo"]
|
| 280 |
+
doc-scrape-examples = true
|
| 281 |
+
|
| 282 |
+
[[example]]
|
| 283 |
+
name = "02_app_settings"
|
| 284 |
+
path = "examples/tutorial_builder/02_app_settings.rs"
|
| 285 |
+
required-features = ["cargo"]
|
| 286 |
+
doc-scrape-examples = true
|
| 287 |
+
|
| 288 |
+
[[example]]
|
| 289 |
+
name = "03_01_flag_bool"
|
| 290 |
+
path = "examples/tutorial_builder/03_01_flag_bool.rs"
|
| 291 |
+
required-features = ["cargo"]
|
| 292 |
+
doc-scrape-examples = true
|
| 293 |
+
|
| 294 |
+
[[example]]
|
| 295 |
+
name = "03_01_flag_count"
|
| 296 |
+
path = "examples/tutorial_builder/03_01_flag_count.rs"
|
| 297 |
+
required-features = ["cargo"]
|
| 298 |
+
doc-scrape-examples = true
|
| 299 |
+
|
| 300 |
+
[[example]]
|
| 301 |
+
name = "03_02_option"
|
| 302 |
+
path = "examples/tutorial_builder/03_02_option.rs"
|
| 303 |
+
required-features = ["cargo"]
|
| 304 |
+
doc-scrape-examples = true
|
| 305 |
+
|
| 306 |
+
[[example]]
|
| 307 |
+
name = "03_02_option_mult"
|
| 308 |
+
path = "examples/tutorial_builder/03_02_option_mult.rs"
|
| 309 |
+
required-features = ["cargo"]
|
| 310 |
+
doc-scrape-examples = true
|
| 311 |
+
|
| 312 |
+
[[example]]
|
| 313 |
+
name = "03_03_positional"
|
| 314 |
+
path = "examples/tutorial_builder/03_03_positional.rs"
|
| 315 |
+
required-features = ["cargo"]
|
| 316 |
+
doc-scrape-examples = true
|
| 317 |
+
|
| 318 |
+
[[example]]
|
| 319 |
+
name = "03_03_positional_mult"
|
| 320 |
+
path = "examples/tutorial_builder/03_03_positional_mult.rs"
|
| 321 |
+
required-features = ["cargo"]
|
| 322 |
+
doc-scrape-examples = true
|
| 323 |
+
|
| 324 |
+
[[example]]
|
| 325 |
+
name = "03_04_subcommands"
|
| 326 |
+
path = "examples/tutorial_builder/03_04_subcommands.rs"
|
| 327 |
+
required-features = ["cargo"]
|
| 328 |
+
doc-scrape-examples = true
|
| 329 |
+
|
| 330 |
+
[[example]]
|
| 331 |
+
name = "03_05_default_values"
|
| 332 |
+
path = "examples/tutorial_builder/03_05_default_values.rs"
|
| 333 |
+
required-features = ["cargo"]
|
| 334 |
+
doc-scrape-examples = true
|
| 335 |
+
|
| 336 |
+
[[example]]
|
| 337 |
+
name = "03_06_required"
|
| 338 |
+
path = "examples/tutorial_builder/03_06_required.rs"
|
| 339 |
+
required-features = ["cargo"]
|
| 340 |
+
doc-scrape-examples = true
|
| 341 |
+
|
| 342 |
+
[[example]]
|
| 343 |
+
name = "04_01_possible"
|
| 344 |
+
path = "examples/tutorial_builder/04_01_possible.rs"
|
| 345 |
+
required-features = ["cargo"]
|
| 346 |
+
doc-scrape-examples = true
|
| 347 |
+
|
| 348 |
+
[[example]]
|
| 349 |
+
name = "04_01_enum"
|
| 350 |
+
path = "examples/tutorial_builder/04_01_enum.rs"
|
| 351 |
+
required-features = ["cargo"]
|
| 352 |
+
doc-scrape-examples = true
|
| 353 |
+
|
| 354 |
+
[[example]]
|
| 355 |
+
name = "04_02_parse"
|
| 356 |
+
path = "examples/tutorial_builder/04_02_parse.rs"
|
| 357 |
+
required-features = ["cargo"]
|
| 358 |
+
doc-scrape-examples = true
|
| 359 |
+
|
| 360 |
+
[[example]]
|
| 361 |
+
name = "04_02_validate"
|
| 362 |
+
path = "examples/tutorial_builder/04_02_validate.rs"
|
| 363 |
+
required-features = ["cargo"]
|
| 364 |
+
doc-scrape-examples = true
|
| 365 |
+
|
| 366 |
+
[[example]]
|
| 367 |
+
name = "04_03_relations"
|
| 368 |
+
path = "examples/tutorial_builder/04_03_relations.rs"
|
| 369 |
+
required-features = ["cargo"]
|
| 370 |
+
doc-scrape-examples = true
|
| 371 |
+
|
| 372 |
+
[[example]]
|
| 373 |
+
name = "04_04_custom"
|
| 374 |
+
path = "examples/tutorial_builder/04_04_custom.rs"
|
| 375 |
+
required-features = ["cargo"]
|
| 376 |
+
doc-scrape-examples = true
|
| 377 |
+
|
| 378 |
+
[[example]]
|
| 379 |
+
name = "05_01_assert"
|
| 380 |
+
path = "examples/tutorial_builder/05_01_assert.rs"
|
| 381 |
+
required-features = ["cargo"]
|
| 382 |
+
test = true
|
| 383 |
+
doc-scrape-examples = true
|
| 384 |
+
|
| 385 |
+
[[example]]
|
| 386 |
+
name = "01_quick_derive"
|
| 387 |
+
path = "examples/tutorial_derive/01_quick.rs"
|
| 388 |
+
required-features = ["derive"]
|
| 389 |
+
doc-scrape-examples = true
|
| 390 |
+
|
| 391 |
+
[[example]]
|
| 392 |
+
name = "02_apps_derive"
|
| 393 |
+
path = "examples/tutorial_derive/02_apps.rs"
|
| 394 |
+
required-features = ["derive"]
|
| 395 |
+
doc-scrape-examples = true
|
| 396 |
+
|
| 397 |
+
[[example]]
|
| 398 |
+
name = "02_crate_derive"
|
| 399 |
+
path = "examples/tutorial_derive/02_crate.rs"
|
| 400 |
+
required-features = ["derive"]
|
| 401 |
+
doc-scrape-examples = true
|
| 402 |
+
|
| 403 |
+
[[example]]
|
| 404 |
+
name = "02_app_settings_derive"
|
| 405 |
+
path = "examples/tutorial_derive/02_app_settings.rs"
|
| 406 |
+
required-features = ["derive"]
|
| 407 |
+
doc-scrape-examples = true
|
| 408 |
+
|
| 409 |
+
[[example]]
|
| 410 |
+
name = "03_01_flag_bool_derive"
|
| 411 |
+
path = "examples/tutorial_derive/03_01_flag_bool.rs"
|
| 412 |
+
required-features = ["derive"]
|
| 413 |
+
doc-scrape-examples = true
|
| 414 |
+
|
| 415 |
+
[[example]]
|
| 416 |
+
name = "03_01_flag_count_derive"
|
| 417 |
+
path = "examples/tutorial_derive/03_01_flag_count.rs"
|
| 418 |
+
required-features = ["derive"]
|
| 419 |
+
doc-scrape-examples = true
|
| 420 |
+
|
| 421 |
+
[[example]]
|
| 422 |
+
name = "03_02_option_derive"
|
| 423 |
+
path = "examples/tutorial_derive/03_02_option.rs"
|
| 424 |
+
required-features = ["derive"]
|
| 425 |
+
doc-scrape-examples = true
|
| 426 |
+
|
| 427 |
+
[[example]]
|
| 428 |
+
name = "03_02_option_mult_derive"
|
| 429 |
+
path = "examples/tutorial_derive/03_02_option_mult.rs"
|
| 430 |
+
required-features = ["derive"]
|
| 431 |
+
doc-scrape-examples = true
|
| 432 |
+
|
| 433 |
+
[[example]]
|
| 434 |
+
name = "03_03_positional_derive"
|
| 435 |
+
path = "examples/tutorial_derive/03_03_positional.rs"
|
| 436 |
+
required-features = ["derive"]
|
| 437 |
+
doc-scrape-examples = true
|
| 438 |
+
|
| 439 |
+
[[example]]
|
| 440 |
+
name = "03_03_positional_mult_derive"
|
| 441 |
+
path = "examples/tutorial_derive/03_03_positional_mult.rs"
|
| 442 |
+
required-features = ["derive"]
|
| 443 |
+
doc-scrape-examples = true
|
| 444 |
+
|
| 445 |
+
[[example]]
|
| 446 |
+
name = "03_04_subcommands_derive"
|
| 447 |
+
path = "examples/tutorial_derive/03_04_subcommands.rs"
|
| 448 |
+
required-features = ["derive"]
|
| 449 |
+
doc-scrape-examples = true
|
| 450 |
+
|
| 451 |
+
[[example]]
|
| 452 |
+
name = "03_04_subcommands_alt_derive"
|
| 453 |
+
path = "examples/tutorial_derive/03_04_subcommands_alt.rs"
|
| 454 |
+
required-features = ["derive"]
|
| 455 |
+
doc-scrape-examples = true
|
| 456 |
+
|
| 457 |
+
[[example]]
|
| 458 |
+
name = "03_05_default_values_derive"
|
| 459 |
+
path = "examples/tutorial_derive/03_05_default_values.rs"
|
| 460 |
+
required-features = ["derive"]
|
| 461 |
+
doc-scrape-examples = true
|
| 462 |
+
|
| 463 |
+
[[example]]
|
| 464 |
+
name = "03_06_optional_derive"
|
| 465 |
+
path = "examples/tutorial_derive/03_06_optional.rs"
|
| 466 |
+
required-features = ["derive"]
|
| 467 |
+
doc-scrape-examples = true
|
| 468 |
+
|
| 469 |
+
[[example]]
|
| 470 |
+
name = "04_01_enum_derive"
|
| 471 |
+
path = "examples/tutorial_derive/04_01_enum.rs"
|
| 472 |
+
required-features = ["derive"]
|
| 473 |
+
doc-scrape-examples = true
|
| 474 |
+
|
| 475 |
+
[[example]]
|
| 476 |
+
name = "04_02_parse_derive"
|
| 477 |
+
path = "examples/tutorial_derive/04_02_parse.rs"
|
| 478 |
+
required-features = ["derive"]
|
| 479 |
+
doc-scrape-examples = true
|
| 480 |
+
|
| 481 |
+
[[example]]
|
| 482 |
+
name = "04_02_validate_derive"
|
| 483 |
+
path = "examples/tutorial_derive/04_02_validate.rs"
|
| 484 |
+
required-features = ["derive"]
|
| 485 |
+
doc-scrape-examples = true
|
| 486 |
+
|
| 487 |
+
[[example]]
|
| 488 |
+
name = "04_03_relations_derive"
|
| 489 |
+
path = "examples/tutorial_derive/04_03_relations.rs"
|
| 490 |
+
required-features = ["derive"]
|
| 491 |
+
doc-scrape-examples = true
|
| 492 |
+
|
| 493 |
+
[[example]]
|
| 494 |
+
name = "04_04_custom_derive"
|
| 495 |
+
path = "examples/tutorial_derive/04_04_custom.rs"
|
| 496 |
+
required-features = ["derive"]
|
| 497 |
+
doc-scrape-examples = true
|
| 498 |
+
|
| 499 |
+
[[example]]
|
| 500 |
+
name = "05_01_assert_derive"
|
| 501 |
+
path = "examples/tutorial_derive/05_01_assert.rs"
|
| 502 |
+
required-features = ["derive"]
|
| 503 |
+
test = true
|
| 504 |
+
doc-scrape-examples = true
|
| 505 |
+
|
| 506 |
+
[[example]]
|
| 507 |
+
name = "interop_augment_args"
|
| 508 |
+
path = "examples/derive_ref/augment_args.rs"
|
| 509 |
+
required-features = ["derive"]
|
| 510 |
+
doc-scrape-examples = true
|
| 511 |
+
|
| 512 |
+
[[example]]
|
| 513 |
+
name = "interop_augment_subcommands"
|
| 514 |
+
path = "examples/derive_ref/augment_subcommands.rs"
|
| 515 |
+
required-features = ["derive"]
|
| 516 |
+
doc-scrape-examples = true
|
| 517 |
+
|
| 518 |
+
[[example]]
|
| 519 |
+
name = "interop_hand_subcommand"
|
| 520 |
+
path = "examples/derive_ref/hand_subcommand.rs"
|
| 521 |
+
required-features = ["derive"]
|
| 522 |
+
doc-scrape-examples = true
|
| 523 |
+
|
| 524 |
+
[[example]]
|
| 525 |
+
name = "interop_flatten_hand_args"
|
| 526 |
+
path = "examples/derive_ref/flatten_hand_args.rs"
|
| 527 |
+
required-features = ["derive"]
|
| 528 |
+
doc-scrape-examples = true
|
| 529 |
+
|
| 530 |
+
[profile.test]
|
| 531 |
+
opt-level = 1
|
| 532 |
+
|
| 533 |
+
[profile.bench]
|
| 534 |
+
lto = true
|
| 535 |
+
codegen-units = 1
|
| 536 |
+
|
| 537 |
+
[lints]
|
| 538 |
+
workspace = true
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright {yyyy} {name of copyright owner}
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
| 202 |
+
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/LICENSE-MIT
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) Individual contributors
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 5 |
+
in the Software without restriction, including without limitation the rights
|
| 6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 7 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 8 |
+
furnished to do so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in all
|
| 11 |
+
copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 19 |
+
SOFTWARE.
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# clap
|
| 2 |
+
|
| 3 |
+
> **Command Line Argument Parser for Rust**
|
| 4 |
+
|
| 5 |
+
[](https://crates.io/crates/clap)
|
| 6 |
+
[](https://crates.io/crates/clap)
|
| 7 |
+
[](LICENSE-APACHE)
|
| 8 |
+
[](LICENSE-MIT)
|
| 9 |
+
[](https://github.com/clap-rs/clap/actions/workflows/ci.yml?query=branch%3Amaster)
|
| 10 |
+
[](https://coveralls.io/github/clap-rs/clap?branch=master)
|
| 11 |
+
[](https://github.com/clap-rs/clap/graphs/contributors)
|
| 12 |
+
|
| 13 |
+
Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT).
|
| 14 |
+
|
| 15 |
+
## Get Started
|
| 16 |
+
|
| 17 |
+
```console
|
| 18 |
+
$ cargo add clap
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
## About
|
| 22 |
+
|
| 23 |
+
Create your command-line parser, with all of the bells and whistles, declaratively or procedurally.
|
| 24 |
+
|
| 25 |
+
For more details, see:
|
| 26 |
+
- [docs.rs](https://docs.rs/clap/latest/clap/)
|
| 27 |
+
- [examples](examples/)
|
| 28 |
+
|
| 29 |
+
## Sponsors
|
| 30 |
+
|
| 31 |
+
<!-- omit in TOC -->
|
| 32 |
+
### Gold
|
| 33 |
+
|
| 34 |
+
[](https://opencollective.com/clap)
|
| 35 |
+
|
| 36 |
+
<!-- omit in TOC -->
|
| 37 |
+
### Silver
|
| 38 |
+
|
| 39 |
+
[](https://opencollective.com/clap)
|
| 40 |
+
|
| 41 |
+
<!-- omit in TOC -->
|
| 42 |
+
### Bronze
|
| 43 |
+
|
| 44 |
+
[](https://opencollective.com/clap)
|
| 45 |
+
|
| 46 |
+
<!-- omit in TOC -->
|
| 47 |
+
### Backer
|
| 48 |
+
|
| 49 |
+
[](https://opencollective.com/clap)
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Examples
|
| 2 |
+
|
| 3 |
+
We try to focus our documentation on the [four types of
|
| 4 |
+
documentation](https://documentation.divio.com/). Examples fit into this by
|
| 5 |
+
providing:
|
| 6 |
+
- [Cookbook / How-To Guides](https://docs.rs/clap/latest/clap/_cookbook/index.html)
|
| 7 |
+
- Tutorials ([derive](https://docs.rs/clap/latest/clap/_derive/_tutorial/index.html), [builder](https://docs.rs/clap/latest/clap/_tutorial/index.html))
|
| 8 |
+
|
| 9 |
+
This directory contains the source for the above.
|
| 10 |
+
|
| 11 |
+
## Contributing
|
| 12 |
+
|
| 13 |
+
New examples should fit within the above structure and support their narrative
|
| 14 |
+
- Add the example to [Cargo.toml](../Cargo.toml) for any `required-features`
|
| 15 |
+
- Document how the example works with a `.md` file which will be verified using [trycmd](https://docs.rs/trycmd)
|
| 16 |
+
- Pull the `.rs` and `.md` file into the appropriate module doc comment to be accessible on docs.rs
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example-derive.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
For more on creating a custom subcommand, see [the cargo
|
| 2 |
+
book](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands).
|
| 3 |
+
The crate [`clap-cargo`](https://github.com/crate-ci/clap-cargo) can help in
|
| 4 |
+
mimicking cargo's interface.
|
| 5 |
+
|
| 6 |
+
The help looks like:
|
| 7 |
+
```console
|
| 8 |
+
$ cargo-example-derive --help
|
| 9 |
+
Usage: cargo <COMMAND>
|
| 10 |
+
|
| 11 |
+
Commands:
|
| 12 |
+
example-derive A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 13 |
+
help Print this message or the help of the given subcommand(s)
|
| 14 |
+
|
| 15 |
+
Options:
|
| 16 |
+
-h, --help Print help
|
| 17 |
+
|
| 18 |
+
$ cargo-example-derive example-derive --help
|
| 19 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 20 |
+
|
| 21 |
+
Usage: cargo example-derive [OPTIONS]
|
| 22 |
+
|
| 23 |
+
Options:
|
| 24 |
+
--manifest-path <MANIFEST_PATH>
|
| 25 |
+
-h, --help Print help
|
| 26 |
+
-V, --version Print version
|
| 27 |
+
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
Then to directly invoke the command, run:
|
| 31 |
+
```console
|
| 32 |
+
$ cargo-example-derive example-derive
|
| 33 |
+
None
|
| 34 |
+
|
| 35 |
+
$ cargo-example-derive example-derive --manifest-path Cargo.toml
|
| 36 |
+
Some("Cargo.toml")
|
| 37 |
+
|
| 38 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example-derive.rs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::Parser;
|
| 2 |
+
|
| 3 |
+
#[derive(Parser)] // requires `derive` feature
|
| 4 |
+
#[command(name = "cargo")]
|
| 5 |
+
#[command(bin_name = "cargo")]
|
| 6 |
+
#[command(styles = CLAP_STYLING)]
|
| 7 |
+
enum CargoCli {
|
| 8 |
+
ExampleDerive(ExampleDeriveArgs),
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
// See also `clap_cargo::style::CLAP_STYLING`
|
| 12 |
+
pub const CLAP_STYLING: clap::builder::styling::Styles = clap::builder::styling::Styles::styled()
|
| 13 |
+
.header(clap_cargo::style::HEADER)
|
| 14 |
+
.usage(clap_cargo::style::USAGE)
|
| 15 |
+
.literal(clap_cargo::style::LITERAL)
|
| 16 |
+
.placeholder(clap_cargo::style::PLACEHOLDER)
|
| 17 |
+
.error(clap_cargo::style::ERROR)
|
| 18 |
+
.valid(clap_cargo::style::VALID)
|
| 19 |
+
.invalid(clap_cargo::style::INVALID);
|
| 20 |
+
|
| 21 |
+
#[derive(clap::Args)]
|
| 22 |
+
#[command(version, about, long_about = None)]
|
| 23 |
+
struct ExampleDeriveArgs {
|
| 24 |
+
#[arg(long)]
|
| 25 |
+
manifest_path: Option<std::path::PathBuf>,
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
fn main() {
|
| 29 |
+
let CargoCli::ExampleDerive(args) = CargoCli::parse();
|
| 30 |
+
println!("{:?}", args.manifest_path);
|
| 31 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
For more on creating a custom subcommand, see [the cargo
|
| 2 |
+
book](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands).
|
| 3 |
+
The crate [`clap-cargo`](https://github.com/crate-ci/clap-cargo) can help in
|
| 4 |
+
mimicking cargo's interface.
|
| 5 |
+
|
| 6 |
+
The help looks like:
|
| 7 |
+
```console
|
| 8 |
+
$ cargo-example --help
|
| 9 |
+
Usage: cargo <COMMAND>
|
| 10 |
+
|
| 11 |
+
Commands:
|
| 12 |
+
example A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 13 |
+
help Print this message or the help of the given subcommand(s)
|
| 14 |
+
|
| 15 |
+
Options:
|
| 16 |
+
-h, --help Print help
|
| 17 |
+
|
| 18 |
+
$ cargo-example example --help
|
| 19 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 20 |
+
|
| 21 |
+
Usage: cargo example [OPTIONS]
|
| 22 |
+
|
| 23 |
+
Options:
|
| 24 |
+
--manifest-path <PATH>
|
| 25 |
+
-h, --help Print help
|
| 26 |
+
-V, --version Print version
|
| 27 |
+
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
Then to directly invoke the command, run:
|
| 31 |
+
```console
|
| 32 |
+
$ cargo-example example
|
| 33 |
+
None
|
| 34 |
+
|
| 35 |
+
$ cargo-example example --manifest-path Cargo.toml
|
| 36 |
+
Some("Cargo.toml")
|
| 37 |
+
|
| 38 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/cargo-example.rs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fn main() {
|
| 2 |
+
let cmd = clap::Command::new("cargo")
|
| 3 |
+
.bin_name("cargo")
|
| 4 |
+
.styles(CLAP_STYLING)
|
| 5 |
+
.subcommand_required(true)
|
| 6 |
+
.subcommand(
|
| 7 |
+
clap::command!("example").arg(
|
| 8 |
+
clap::arg!(--"manifest-path" <PATH>)
|
| 9 |
+
.value_parser(clap::value_parser!(std::path::PathBuf)),
|
| 10 |
+
),
|
| 11 |
+
);
|
| 12 |
+
let matches = cmd.get_matches();
|
| 13 |
+
let matches = match matches.subcommand() {
|
| 14 |
+
Some(("example", matches)) => matches,
|
| 15 |
+
_ => unreachable!("clap should ensure we don't get here"),
|
| 16 |
+
};
|
| 17 |
+
let manifest_path = matches.get_one::<std::path::PathBuf>("manifest-path");
|
| 18 |
+
println!("{manifest_path:?}");
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
// See also `clap_cargo::style::CLAP_STYLING`
|
| 22 |
+
pub const CLAP_STYLING: clap::builder::styling::Styles = clap::builder::styling::Styles::styled()
|
| 23 |
+
.header(clap_cargo::style::HEADER)
|
| 24 |
+
.usage(clap_cargo::style::USAGE)
|
| 25 |
+
.literal(clap_cargo::style::LITERAL)
|
| 26 |
+
.placeholder(clap_cargo::style::PLACEHOLDER)
|
| 27 |
+
.error(clap_cargo::style::ERROR)
|
| 28 |
+
.valid(clap_cargo::style::VALID)
|
| 29 |
+
.invalid(clap_cargo::style::INVALID);
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/demo.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```console
|
| 2 |
+
$ demo --help
|
| 3 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 4 |
+
|
| 5 |
+
Usage: demo[EXE] [OPTIONS] --name <NAME>
|
| 6 |
+
|
| 7 |
+
Options:
|
| 8 |
+
-n, --name <NAME> Name of the person to greet
|
| 9 |
+
-c, --count <COUNT> Number of times to greet [default: 1]
|
| 10 |
+
-h, --help Print help
|
| 11 |
+
-V, --version Print version
|
| 12 |
+
|
| 13 |
+
$ demo --name Me
|
| 14 |
+
Hello Me!
|
| 15 |
+
|
| 16 |
+
```
|
| 17 |
+
*(version number and `.exe` extension on windows replaced by placeholders)*
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/demo.rs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::Parser;
|
| 2 |
+
|
| 3 |
+
/// Simple program to greet a person
|
| 4 |
+
#[derive(Parser, Debug)]
|
| 5 |
+
#[command(version, about, long_about = None)]
|
| 6 |
+
struct Args {
|
| 7 |
+
/// Name of the person to greet
|
| 8 |
+
#[arg(short, long)]
|
| 9 |
+
name: String,
|
| 10 |
+
|
| 11 |
+
/// Number of times to greet
|
| 12 |
+
#[arg(short, long, default_value_t = 1)]
|
| 13 |
+
count: u8,
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
fn main() {
|
| 17 |
+
let args = Args::parse();
|
| 18 |
+
|
| 19 |
+
for _ in 0..args.count {
|
| 20 |
+
println!("Hello {}!", args.name);
|
| 21 |
+
}
|
| 22 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/augment_args.rs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::{arg, Args, Command, FromArgMatches as _};
|
| 2 |
+
|
| 3 |
+
#[derive(Args, Debug)]
|
| 4 |
+
struct DerivedArgs {
|
| 5 |
+
#[arg(short, long)]
|
| 6 |
+
derived: bool,
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
fn main() {
|
| 10 |
+
let cli = Command::new("CLI").arg(arg!(-b - -built).action(clap::ArgAction::SetTrue));
|
| 11 |
+
// Augment built args with derived args
|
| 12 |
+
let cli = DerivedArgs::augment_args(cli);
|
| 13 |
+
|
| 14 |
+
let matches = cli.get_matches();
|
| 15 |
+
println!("Value of built: {:?}", matches.get_flag("built"));
|
| 16 |
+
println!(
|
| 17 |
+
"Value of derived via ArgMatches: {:?}",
|
| 18 |
+
matches.get_flag("derived")
|
| 19 |
+
);
|
| 20 |
+
|
| 21 |
+
// Since DerivedArgs implements FromArgMatches, we can extract it from the unstructured ArgMatches.
|
| 22 |
+
// This is the main benefit of using derived arguments.
|
| 23 |
+
let derived_matches = DerivedArgs::from_arg_matches(&matches)
|
| 24 |
+
.map_err(|err| err.exit())
|
| 25 |
+
.unwrap();
|
| 26 |
+
println!("Value of derived: {derived_matches:#?}");
|
| 27 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/augment_subcommands.rs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::{Command, FromArgMatches as _, Parser, Subcommand as _};
|
| 2 |
+
|
| 3 |
+
#[derive(Parser, Debug)]
|
| 4 |
+
enum Subcommands {
|
| 5 |
+
Derived {
|
| 6 |
+
#[arg(short, long)]
|
| 7 |
+
derived_flag: bool,
|
| 8 |
+
},
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
fn main() {
|
| 12 |
+
let cli = Command::new("Built CLI");
|
| 13 |
+
// Augment with derived subcommands
|
| 14 |
+
let cli = Subcommands::augment_subcommands(cli);
|
| 15 |
+
|
| 16 |
+
let matches = cli.get_matches();
|
| 17 |
+
let derived_subcommands = Subcommands::from_arg_matches(&matches)
|
| 18 |
+
.map_err(|err| err.exit())
|
| 19 |
+
.unwrap();
|
| 20 |
+
println!("Derived subcommands: {derived_subcommands:#?}");
|
| 21 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/flatten_hand_args.rs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::error::Error;
|
| 2 |
+
use clap::{Arg, ArgAction, ArgMatches, Args, Command, FromArgMatches, Parser};
|
| 3 |
+
|
| 4 |
+
#[derive(Debug)]
|
| 5 |
+
struct CliArgs {
|
| 6 |
+
foo: bool,
|
| 7 |
+
bar: bool,
|
| 8 |
+
quuz: Option<String>,
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
impl FromArgMatches for CliArgs {
|
| 12 |
+
fn from_arg_matches(matches: &ArgMatches) -> Result<Self, Error> {
|
| 13 |
+
let mut matches = matches.clone();
|
| 14 |
+
Self::from_arg_matches_mut(&mut matches)
|
| 15 |
+
}
|
| 16 |
+
fn from_arg_matches_mut(matches: &mut ArgMatches) -> Result<Self, Error> {
|
| 17 |
+
Ok(Self {
|
| 18 |
+
foo: matches.get_flag("foo"),
|
| 19 |
+
bar: matches.get_flag("bar"),
|
| 20 |
+
quuz: matches.remove_one::<String>("quuz"),
|
| 21 |
+
})
|
| 22 |
+
}
|
| 23 |
+
fn update_from_arg_matches(&mut self, matches: &ArgMatches) -> Result<(), Error> {
|
| 24 |
+
let mut matches = matches.clone();
|
| 25 |
+
self.update_from_arg_matches_mut(&mut matches)
|
| 26 |
+
}
|
| 27 |
+
fn update_from_arg_matches_mut(&mut self, matches: &mut ArgMatches) -> Result<(), Error> {
|
| 28 |
+
self.foo |= matches.get_flag("foo");
|
| 29 |
+
self.bar |= matches.get_flag("bar");
|
| 30 |
+
if let Some(quuz) = matches.remove_one::<String>("quuz") {
|
| 31 |
+
self.quuz = Some(quuz);
|
| 32 |
+
}
|
| 33 |
+
Ok(())
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
impl Args for CliArgs {
|
| 38 |
+
fn augment_args(cmd: Command) -> Command {
|
| 39 |
+
cmd.arg(
|
| 40 |
+
Arg::new("foo")
|
| 41 |
+
.short('f')
|
| 42 |
+
.long("foo")
|
| 43 |
+
.action(ArgAction::SetTrue),
|
| 44 |
+
)
|
| 45 |
+
.arg(
|
| 46 |
+
Arg::new("bar")
|
| 47 |
+
.short('b')
|
| 48 |
+
.long("bar")
|
| 49 |
+
.action(ArgAction::SetTrue),
|
| 50 |
+
)
|
| 51 |
+
.arg(
|
| 52 |
+
Arg::new("quuz")
|
| 53 |
+
.short('q')
|
| 54 |
+
.long("quuz")
|
| 55 |
+
.action(ArgAction::Set),
|
| 56 |
+
)
|
| 57 |
+
}
|
| 58 |
+
fn augment_args_for_update(cmd: Command) -> Command {
|
| 59 |
+
cmd.arg(
|
| 60 |
+
Arg::new("foo")
|
| 61 |
+
.short('f')
|
| 62 |
+
.long("foo")
|
| 63 |
+
.action(ArgAction::SetTrue),
|
| 64 |
+
)
|
| 65 |
+
.arg(
|
| 66 |
+
Arg::new("bar")
|
| 67 |
+
.short('b')
|
| 68 |
+
.long("bar")
|
| 69 |
+
.action(ArgAction::SetTrue),
|
| 70 |
+
)
|
| 71 |
+
.arg(
|
| 72 |
+
Arg::new("quuz")
|
| 73 |
+
.short('q')
|
| 74 |
+
.long("quuz")
|
| 75 |
+
.action(ArgAction::Set),
|
| 76 |
+
)
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
#[derive(Parser, Debug)]
|
| 81 |
+
struct Cli {
|
| 82 |
+
#[arg(short, long)]
|
| 83 |
+
top_level: bool,
|
| 84 |
+
#[command(flatten)]
|
| 85 |
+
more_args: CliArgs,
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
fn main() {
|
| 89 |
+
let args = Cli::parse();
|
| 90 |
+
println!("{args:#?}");
|
| 91 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/hand_subcommand.rs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#![allow(dead_code)]
|
| 2 |
+
use clap::error::{Error, ErrorKind};
|
| 3 |
+
use clap::{ArgMatches, Args as _, Command, FromArgMatches, Parser, Subcommand};
|
| 4 |
+
|
| 5 |
+
#[derive(Parser, Debug)]
|
| 6 |
+
struct AddArgs {
|
| 7 |
+
name: Vec<String>,
|
| 8 |
+
}
|
| 9 |
+
#[derive(Parser, Debug)]
|
| 10 |
+
struct RemoveArgs {
|
| 11 |
+
#[arg(short, long)]
|
| 12 |
+
force: bool,
|
| 13 |
+
name: Vec<String>,
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
#[derive(Debug)]
|
| 17 |
+
enum CliSub {
|
| 18 |
+
Add(AddArgs),
|
| 19 |
+
Remove(RemoveArgs),
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
impl FromArgMatches for CliSub {
|
| 23 |
+
fn from_arg_matches(matches: &ArgMatches) -> Result<Self, Error> {
|
| 24 |
+
match matches.subcommand() {
|
| 25 |
+
Some(("add", args)) => Ok(Self::Add(AddArgs::from_arg_matches(args)?)),
|
| 26 |
+
Some(("remove", args)) => Ok(Self::Remove(RemoveArgs::from_arg_matches(args)?)),
|
| 27 |
+
Some((_, _)) => Err(Error::raw(
|
| 28 |
+
ErrorKind::InvalidSubcommand,
|
| 29 |
+
"Valid subcommands are `add` and `remove`",
|
| 30 |
+
)),
|
| 31 |
+
None => Err(Error::raw(
|
| 32 |
+
ErrorKind::MissingSubcommand,
|
| 33 |
+
"Valid subcommands are `add` and `remove`",
|
| 34 |
+
)),
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
fn update_from_arg_matches(&mut self, matches: &ArgMatches) -> Result<(), Error> {
|
| 38 |
+
match matches.subcommand() {
|
| 39 |
+
Some(("add", args)) => *self = Self::Add(AddArgs::from_arg_matches(args)?),
|
| 40 |
+
Some(("remove", args)) => *self = Self::Remove(RemoveArgs::from_arg_matches(args)?),
|
| 41 |
+
Some((_, _)) => {
|
| 42 |
+
return Err(Error::raw(
|
| 43 |
+
ErrorKind::InvalidSubcommand,
|
| 44 |
+
"Valid subcommands are `add` and `remove`",
|
| 45 |
+
))
|
| 46 |
+
}
|
| 47 |
+
None => (),
|
| 48 |
+
};
|
| 49 |
+
Ok(())
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
impl Subcommand for CliSub {
|
| 54 |
+
fn augment_subcommands(cmd: Command) -> Command {
|
| 55 |
+
cmd.subcommand(AddArgs::augment_args(Command::new("add")))
|
| 56 |
+
.subcommand(RemoveArgs::augment_args(Command::new("remove")))
|
| 57 |
+
.subcommand_required(true)
|
| 58 |
+
}
|
| 59 |
+
fn augment_subcommands_for_update(cmd: Command) -> Command {
|
| 60 |
+
cmd.subcommand(AddArgs::augment_args(Command::new("add")))
|
| 61 |
+
.subcommand(RemoveArgs::augment_args(Command::new("remove")))
|
| 62 |
+
.subcommand_required(true)
|
| 63 |
+
}
|
| 64 |
+
fn has_subcommand(name: &str) -> bool {
|
| 65 |
+
matches!(name, "add" | "remove")
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
#[derive(Parser, Debug)]
|
| 70 |
+
struct Cli {
|
| 71 |
+
#[arg(short, long)]
|
| 72 |
+
top_level: bool,
|
| 73 |
+
#[command(subcommand)]
|
| 74 |
+
subcommand: CliSub,
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
fn main() {
|
| 78 |
+
let args = Cli::parse();
|
| 79 |
+
println!("{args:#?}");
|
| 80 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/derive_ref/interop_tests.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Following are tests for the interop examples in this directory.
|
| 2 |
+
|
| 3 |
+
## Augment Args
|
| 4 |
+
|
| 5 |
+
```console
|
| 6 |
+
$ interop_augment_args
|
| 7 |
+
Value of built: false
|
| 8 |
+
Value of derived via ArgMatches: false
|
| 9 |
+
Value of derived: DerivedArgs {
|
| 10 |
+
derived: false,
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
```console
|
| 16 |
+
$ interop_augment_args -b --derived
|
| 17 |
+
Value of built: true
|
| 18 |
+
Value of derived via ArgMatches: true
|
| 19 |
+
Value of derived: DerivedArgs {
|
| 20 |
+
derived: true,
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
```console
|
| 26 |
+
$ interop_augment_args -d --built
|
| 27 |
+
Value of built: true
|
| 28 |
+
Value of derived via ArgMatches: true
|
| 29 |
+
Value of derived: DerivedArgs {
|
| 30 |
+
derived: true,
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
```console
|
| 36 |
+
$ interop_augment_args --unknown
|
| 37 |
+
? failed
|
| 38 |
+
error: unexpected argument '--unknown' found
|
| 39 |
+
|
| 40 |
+
Usage: interop_augment_args[EXE] [OPTIONS]
|
| 41 |
+
|
| 42 |
+
For more information, try '--help'.
|
| 43 |
+
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Augment Subcommands
|
| 47 |
+
|
| 48 |
+
```console
|
| 49 |
+
$ interop_augment_subcommands
|
| 50 |
+
? failed
|
| 51 |
+
error: a subcommand is required but one was not provided
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
```console
|
| 55 |
+
$ interop_augment_subcommands derived
|
| 56 |
+
Derived subcommands: Derived {
|
| 57 |
+
derived_flag: false,
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
```console
|
| 63 |
+
$ interop_augment_subcommands derived --derived-flag
|
| 64 |
+
Derived subcommands: Derived {
|
| 65 |
+
derived_flag: true,
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
```console
|
| 71 |
+
$ interop_augment_subcommands derived --unknown
|
| 72 |
+
? failed
|
| 73 |
+
error: unexpected argument '--unknown' found
|
| 74 |
+
|
| 75 |
+
Usage: interop_augment_subcommands[EXE] derived [OPTIONS]
|
| 76 |
+
|
| 77 |
+
For more information, try '--help'.
|
| 78 |
+
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
```console
|
| 82 |
+
$ interop_augment_subcommands unknown
|
| 83 |
+
? failed
|
| 84 |
+
error: unrecognized subcommand 'unknown'
|
| 85 |
+
|
| 86 |
+
Usage: interop_augment_subcommands[EXE] [COMMAND]
|
| 87 |
+
|
| 88 |
+
For more information, try '--help'.
|
| 89 |
+
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
## Hand-Implemented Subcommand
|
| 93 |
+
|
| 94 |
+
```console
|
| 95 |
+
$ interop_hand_subcommand
|
| 96 |
+
? failed
|
| 97 |
+
Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>
|
| 98 |
+
|
| 99 |
+
Commands:
|
| 100 |
+
add
|
| 101 |
+
remove
|
| 102 |
+
help Print this message or the help of the given subcommand(s)
|
| 103 |
+
|
| 104 |
+
Options:
|
| 105 |
+
-t, --top-level
|
| 106 |
+
-h, --help Print help
|
| 107 |
+
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
```console
|
| 111 |
+
$ interop_hand_subcommand add
|
| 112 |
+
Cli {
|
| 113 |
+
top_level: false,
|
| 114 |
+
subcommand: Add(
|
| 115 |
+
AddArgs {
|
| 116 |
+
name: [],
|
| 117 |
+
},
|
| 118 |
+
),
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
```console
|
| 124 |
+
$ interop_hand_subcommand add a b c
|
| 125 |
+
Cli {
|
| 126 |
+
top_level: false,
|
| 127 |
+
subcommand: Add(
|
| 128 |
+
AddArgs {
|
| 129 |
+
name: [
|
| 130 |
+
"a",
|
| 131 |
+
"b",
|
| 132 |
+
"c",
|
| 133 |
+
],
|
| 134 |
+
},
|
| 135 |
+
),
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
```console
|
| 141 |
+
$ interop_hand_subcommand add --unknown
|
| 142 |
+
? failed
|
| 143 |
+
error: unexpected argument '--unknown' found
|
| 144 |
+
|
| 145 |
+
tip: to pass '--unknown' as a value, use '-- --unknown'
|
| 146 |
+
|
| 147 |
+
Usage: interop_hand_subcommand[EXE] add [NAME]...
|
| 148 |
+
|
| 149 |
+
For more information, try '--help'.
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
```console
|
| 154 |
+
$ interop_hand_subcommand remove
|
| 155 |
+
Cli {
|
| 156 |
+
top_level: false,
|
| 157 |
+
subcommand: Remove(
|
| 158 |
+
RemoveArgs {
|
| 159 |
+
force: false,
|
| 160 |
+
name: [],
|
| 161 |
+
},
|
| 162 |
+
),
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
```console
|
| 168 |
+
$ interop_hand_subcommand remove --force a b c
|
| 169 |
+
Cli {
|
| 170 |
+
top_level: false,
|
| 171 |
+
subcommand: Remove(
|
| 172 |
+
RemoveArgs {
|
| 173 |
+
force: true,
|
| 174 |
+
name: [
|
| 175 |
+
"a",
|
| 176 |
+
"b",
|
| 177 |
+
"c",
|
| 178 |
+
],
|
| 179 |
+
},
|
| 180 |
+
),
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
```console
|
| 186 |
+
$ interop_hand_subcommand unknown
|
| 187 |
+
? failed
|
| 188 |
+
error: unrecognized subcommand 'unknown'
|
| 189 |
+
|
| 190 |
+
Usage: interop_hand_subcommand[EXE] [OPTIONS] <COMMAND>
|
| 191 |
+
|
| 192 |
+
For more information, try '--help'.
|
| 193 |
+
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
## Flatten Hand-Implemented Args
|
| 197 |
+
|
| 198 |
+
```console
|
| 199 |
+
$ interop_flatten_hand_args
|
| 200 |
+
Cli {
|
| 201 |
+
top_level: false,
|
| 202 |
+
more_args: CliArgs {
|
| 203 |
+
foo: false,
|
| 204 |
+
bar: false,
|
| 205 |
+
quuz: None,
|
| 206 |
+
},
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
```
|
| 210 |
+
|
| 211 |
+
```console
|
| 212 |
+
$ interop_flatten_hand_args -f --bar
|
| 213 |
+
Cli {
|
| 214 |
+
top_level: false,
|
| 215 |
+
more_args: CliArgs {
|
| 216 |
+
foo: true,
|
| 217 |
+
bar: true,
|
| 218 |
+
quuz: None,
|
| 219 |
+
},
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
```
|
| 223 |
+
|
| 224 |
+
```console
|
| 225 |
+
$ interop_flatten_hand_args --quuz abc
|
| 226 |
+
Cli {
|
| 227 |
+
top_level: false,
|
| 228 |
+
more_args: CliArgs {
|
| 229 |
+
foo: false,
|
| 230 |
+
bar: false,
|
| 231 |
+
quuz: Some(
|
| 232 |
+
"abc",
|
| 233 |
+
),
|
| 234 |
+
},
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
```
|
| 238 |
+
|
| 239 |
+
```console
|
| 240 |
+
$ interop_flatten_hand_args --unknown
|
| 241 |
+
? failed
|
| 242 |
+
error: unexpected argument '--unknown' found
|
| 243 |
+
|
| 244 |
+
Usage: interop_flatten_hand_args[EXE] [OPTIONS]
|
| 245 |
+
|
| 246 |
+
For more information, try '--help'.
|
| 247 |
+
|
| 248 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional-derive.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
**This requires enabling the [`derive` feature flag][crate::_features].**
|
| 2 |
+
|
| 3 |
+
You can use `--` to escape further arguments.
|
| 4 |
+
|
| 5 |
+
Let's see what this looks like in the help:
|
| 6 |
+
```console
|
| 7 |
+
$ escaped-positional-derive --help
|
| 8 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 9 |
+
|
| 10 |
+
Usage: escaped-positional-derive[EXE] [OPTIONS] [-- <SLOP>...]
|
| 11 |
+
|
| 12 |
+
Arguments:
|
| 13 |
+
[SLOP]...
|
| 14 |
+
|
| 15 |
+
Options:
|
| 16 |
+
-f
|
| 17 |
+
-p <PEAR>
|
| 18 |
+
-h, --help Print help
|
| 19 |
+
-V, --version Print version
|
| 20 |
+
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
Here is a baseline without any arguments:
|
| 24 |
+
```console
|
| 25 |
+
$ escaped-positional-derive
|
| 26 |
+
-f used: false
|
| 27 |
+
-p's value: None
|
| 28 |
+
'slops' values: []
|
| 29 |
+
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
Notice that we can't pass positional arguments before `--`:
|
| 33 |
+
```console
|
| 34 |
+
$ escaped-positional-derive foo bar
|
| 35 |
+
? failed
|
| 36 |
+
error: unexpected argument 'foo' found
|
| 37 |
+
|
| 38 |
+
Usage: escaped-positional-derive[EXE] [OPTIONS] [-- <SLOP>...]
|
| 39 |
+
|
| 40 |
+
For more information, try '--help'.
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
But you can after:
|
| 45 |
+
```console
|
| 46 |
+
$ escaped-positional-derive -f -p=bob -- sloppy slop slop
|
| 47 |
+
-f used: true
|
| 48 |
+
-p's value: Some("bob")
|
| 49 |
+
'slops' values: ["sloppy", "slop", "slop"]
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
As mentioned, the parser will directly pass everything through:
|
| 54 |
+
```console
|
| 55 |
+
$ escaped-positional-derive -- -f -p=bob sloppy slop slop
|
| 56 |
+
-f used: false
|
| 57 |
+
-p's value: None
|
| 58 |
+
'slops' values: ["-f", "-p=bob", "sloppy", "slop", "slop"]
|
| 59 |
+
|
| 60 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional-derive.rs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::Parser;
|
| 2 |
+
|
| 3 |
+
#[derive(Parser)] // requires `derive` feature
|
| 4 |
+
#[command(version, about, long_about = None)]
|
| 5 |
+
struct Cli {
|
| 6 |
+
#[arg(short = 'f')]
|
| 7 |
+
eff: bool,
|
| 8 |
+
|
| 9 |
+
#[arg(short = 'p', value_name = "PEAR")]
|
| 10 |
+
pea: Option<String>,
|
| 11 |
+
|
| 12 |
+
#[arg(last = true)]
|
| 13 |
+
slop: Vec<String>,
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
fn main() {
|
| 17 |
+
let args = Cli::parse();
|
| 18 |
+
|
| 19 |
+
// This is what will happen with `myprog -f -p=bob -- sloppy slop slop`...
|
| 20 |
+
println!("-f used: {:?}", args.eff); // -f used: true
|
| 21 |
+
println!("-p's value: {:?}", args.pea); // -p's value: Some("bob")
|
| 22 |
+
println!("'slops' values: {:?}", args.slop); // 'slops' values: Some(["sloppy", "slop", "slop"])
|
| 23 |
+
|
| 24 |
+
// Continued program logic goes here...
|
| 25 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
**This requires enabling the [`cargo` feature flag][crate::_features].**
|
| 2 |
+
|
| 3 |
+
You can use `--` to escape further arguments.
|
| 4 |
+
|
| 5 |
+
Let's see what this looks like in the help:
|
| 6 |
+
```console
|
| 7 |
+
$ escaped-positional --help
|
| 8 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 9 |
+
|
| 10 |
+
Usage: escaped-positional[EXE] [OPTIONS] [-- <SLOP>...]
|
| 11 |
+
|
| 12 |
+
Arguments:
|
| 13 |
+
[SLOP]...
|
| 14 |
+
|
| 15 |
+
Options:
|
| 16 |
+
-f
|
| 17 |
+
-p <PEAR>
|
| 18 |
+
-h, --help Print help
|
| 19 |
+
-V, --version Print version
|
| 20 |
+
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
Here is a baseline without any arguments:
|
| 24 |
+
```console
|
| 25 |
+
$ escaped-positional
|
| 26 |
+
-f used: false
|
| 27 |
+
-p's value: None
|
| 28 |
+
'slops' values: []
|
| 29 |
+
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
Notice that we can't pass positional arguments before `--`:
|
| 33 |
+
```console
|
| 34 |
+
$ escaped-positional foo bar
|
| 35 |
+
? failed
|
| 36 |
+
error: unexpected argument 'foo' found
|
| 37 |
+
|
| 38 |
+
Usage: escaped-positional[EXE] [OPTIONS] [-- <SLOP>...]
|
| 39 |
+
|
| 40 |
+
For more information, try '--help'.
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
But you can after:
|
| 45 |
+
```console
|
| 46 |
+
$ escaped-positional -f -p=bob -- sloppy slop slop
|
| 47 |
+
-f used: true
|
| 48 |
+
-p's value: Some("bob")
|
| 49 |
+
'slops' values: ["sloppy", "slop", "slop"]
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
As mentioned, the parser will directly pass everything through:
|
| 54 |
+
```console
|
| 55 |
+
$ escaped-positional -- -f -p=bob sloppy slop slop
|
| 56 |
+
-f used: false
|
| 57 |
+
-p's value: None
|
| 58 |
+
'slops' values: ["-f", "-p=bob", "sloppy", "slop", "slop"]
|
| 59 |
+
|
| 60 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/escaped-positional.rs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::{arg, command, value_parser, ArgAction};
|
| 2 |
+
|
| 3 |
+
fn main() {
|
| 4 |
+
let matches = command!() // requires `cargo` feature
|
| 5 |
+
.arg(arg!(eff: -f).action(ArgAction::SetTrue))
|
| 6 |
+
.arg(arg!(pea: -p <PEAR>).value_parser(value_parser!(String)))
|
| 7 |
+
.arg(
|
| 8 |
+
// Indicates that `slop` is only accessible after `--`.
|
| 9 |
+
arg!(slop: [SLOP])
|
| 10 |
+
.num_args(1..)
|
| 11 |
+
.last(true)
|
| 12 |
+
.value_parser(value_parser!(String)),
|
| 13 |
+
)
|
| 14 |
+
.get_matches();
|
| 15 |
+
|
| 16 |
+
// This is what will happen with `myprog -f -p=bob -- sloppy slop slop`...
|
| 17 |
+
|
| 18 |
+
// -f used: true
|
| 19 |
+
println!("-f used: {:?}", matches.get_flag("eff"));
|
| 20 |
+
// -p's value: Some("bob")
|
| 21 |
+
println!("-p's value: {:?}", matches.get_one::<String>("pea"));
|
| 22 |
+
// 'slops' values: Some(["sloppy", "slop", "slop"])
|
| 23 |
+
println!(
|
| 24 |
+
"'slops' values: {:?}",
|
| 25 |
+
matches
|
| 26 |
+
.get_many::<String>("slop")
|
| 27 |
+
.map(|vals| vals.collect::<Vec<_>>())
|
| 28 |
+
.unwrap_or_default()
|
| 29 |
+
);
|
| 30 |
+
|
| 31 |
+
// Continued program logic goes here...
|
| 32 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/find.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
`find` is an example of position-sensitive flags
|
| 2 |
+
|
| 3 |
+
```console
|
| 4 |
+
$ find --help
|
| 5 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 6 |
+
|
| 7 |
+
Usage: find[EXE] [OPTIONS]
|
| 8 |
+
|
| 9 |
+
Options:
|
| 10 |
+
-h, --help Print help
|
| 11 |
+
-V, --version Print version
|
| 12 |
+
|
| 13 |
+
TESTS:
|
| 14 |
+
--empty File is empty and is either a regular file or a directory
|
| 15 |
+
--name <name> Base of file name (the path with the leading directories removed) matches shell
|
| 16 |
+
pattern pattern
|
| 17 |
+
|
| 18 |
+
OPERATORS:
|
| 19 |
+
-o, --or expr2 is not evaluate if exp1 is true
|
| 20 |
+
-a, --and Same as `expr1 expr1`
|
| 21 |
+
|
| 22 |
+
$ find --empty -o --name .keep
|
| 23 |
+
[
|
| 24 |
+
(
|
| 25 |
+
"empty",
|
| 26 |
+
Bool(
|
| 27 |
+
true,
|
| 28 |
+
),
|
| 29 |
+
),
|
| 30 |
+
(
|
| 31 |
+
"or",
|
| 32 |
+
Bool(
|
| 33 |
+
true,
|
| 34 |
+
),
|
| 35 |
+
),
|
| 36 |
+
(
|
| 37 |
+
"name",
|
| 38 |
+
String(
|
| 39 |
+
".keep",
|
| 40 |
+
),
|
| 41 |
+
),
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
$ find --empty -o --name .keep -o --name foo
|
| 45 |
+
[
|
| 46 |
+
(
|
| 47 |
+
"empty",
|
| 48 |
+
Bool(
|
| 49 |
+
true,
|
| 50 |
+
),
|
| 51 |
+
),
|
| 52 |
+
(
|
| 53 |
+
"or",
|
| 54 |
+
Bool(
|
| 55 |
+
true,
|
| 56 |
+
),
|
| 57 |
+
),
|
| 58 |
+
(
|
| 59 |
+
"name",
|
| 60 |
+
String(
|
| 61 |
+
".keep",
|
| 62 |
+
),
|
| 63 |
+
),
|
| 64 |
+
(
|
| 65 |
+
"or",
|
| 66 |
+
Bool(
|
| 67 |
+
true,
|
| 68 |
+
),
|
| 69 |
+
),
|
| 70 |
+
(
|
| 71 |
+
"name",
|
| 72 |
+
String(
|
| 73 |
+
"foo",
|
| 74 |
+
),
|
| 75 |
+
),
|
| 76 |
+
]
|
| 77 |
+
|
| 78 |
+
```
|
| 79 |
+
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/find.rs
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::collections::BTreeMap;
|
| 2 |
+
|
| 3 |
+
use clap::{command, value_parser, Arg, ArgAction, ArgGroup, ArgMatches, Command};
|
| 4 |
+
|
| 5 |
+
fn main() {
|
| 6 |
+
let matches = cli().get_matches();
|
| 7 |
+
let values = Value::from_matches(&matches);
|
| 8 |
+
println!("{values:#?}");
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
fn cli() -> Command {
|
| 12 |
+
command!()
|
| 13 |
+
.group(ArgGroup::new("tests").multiple(true))
|
| 14 |
+
.next_help_heading("TESTS")
|
| 15 |
+
.args([
|
| 16 |
+
position_sensitive_flag(Arg::new("empty"))
|
| 17 |
+
.long("empty")
|
| 18 |
+
.action(ArgAction::Append)
|
| 19 |
+
.help("File is empty and is either a regular file or a directory")
|
| 20 |
+
.group("tests"),
|
| 21 |
+
Arg::new("name")
|
| 22 |
+
.long("name")
|
| 23 |
+
.action(ArgAction::Append)
|
| 24 |
+
.help("Base of file name (the path with the leading directories removed) matches shell pattern pattern")
|
| 25 |
+
.group("tests")
|
| 26 |
+
])
|
| 27 |
+
.group(ArgGroup::new("operators").multiple(true))
|
| 28 |
+
.next_help_heading("OPERATORS")
|
| 29 |
+
.args([
|
| 30 |
+
position_sensitive_flag(Arg::new("or"))
|
| 31 |
+
.short('o')
|
| 32 |
+
.long("or")
|
| 33 |
+
.action(ArgAction::Append)
|
| 34 |
+
.help("expr2 is not evaluate if exp1 is true")
|
| 35 |
+
.group("operators"),
|
| 36 |
+
position_sensitive_flag(Arg::new("and"))
|
| 37 |
+
.short('a')
|
| 38 |
+
.long("and")
|
| 39 |
+
.action(ArgAction::Append)
|
| 40 |
+
.help("Same as `expr1 expr1`")
|
| 41 |
+
.group("operators"),
|
| 42 |
+
])
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
fn position_sensitive_flag(arg: Arg) -> Arg {
|
| 46 |
+
// Flags don't track the position of each occurrence, so we need to emulate flags with
|
| 47 |
+
// value-less options to get the same result
|
| 48 |
+
arg.num_args(0)
|
| 49 |
+
.value_parser(value_parser!(bool))
|
| 50 |
+
.default_missing_value("true")
|
| 51 |
+
.default_value("false")
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
|
| 55 |
+
pub enum Value {
|
| 56 |
+
Bool(bool),
|
| 57 |
+
String(String),
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
impl Value {
|
| 61 |
+
pub fn from_matches(matches: &ArgMatches) -> Vec<(clap::Id, Self)> {
|
| 62 |
+
let mut values = BTreeMap::new();
|
| 63 |
+
for id in matches.ids() {
|
| 64 |
+
if matches.try_get_many::<clap::Id>(id.as_str()).is_ok() {
|
| 65 |
+
// ignore groups
|
| 66 |
+
continue;
|
| 67 |
+
}
|
| 68 |
+
let value_source = matches
|
| 69 |
+
.value_source(id.as_str())
|
| 70 |
+
.expect("id came from matches");
|
| 71 |
+
if value_source != clap::parser::ValueSource::CommandLine {
|
| 72 |
+
// Any other source just gets tacked on at the end (like default values)
|
| 73 |
+
continue;
|
| 74 |
+
}
|
| 75 |
+
if Self::extract::<String>(matches, id, &mut values) {
|
| 76 |
+
continue;
|
| 77 |
+
}
|
| 78 |
+
if Self::extract::<bool>(matches, id, &mut values) {
|
| 79 |
+
continue;
|
| 80 |
+
}
|
| 81 |
+
unimplemented!("unknown type for {id}: {matches:?}");
|
| 82 |
+
}
|
| 83 |
+
values.into_values().collect::<Vec<_>>()
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
fn extract<T: Clone + Into<Value> + Send + Sync + 'static>(
|
| 87 |
+
matches: &ArgMatches,
|
| 88 |
+
id: &clap::Id,
|
| 89 |
+
output: &mut BTreeMap<usize, (clap::Id, Self)>,
|
| 90 |
+
) -> bool {
|
| 91 |
+
match matches.try_get_many::<T>(id.as_str()) {
|
| 92 |
+
Ok(Some(values)) => {
|
| 93 |
+
for (value, index) in values.zip(
|
| 94 |
+
matches
|
| 95 |
+
.indices_of(id.as_str())
|
| 96 |
+
.expect("id came from matches"),
|
| 97 |
+
) {
|
| 98 |
+
output.insert(index, (id.clone(), value.clone().into()));
|
| 99 |
+
}
|
| 100 |
+
true
|
| 101 |
+
}
|
| 102 |
+
Ok(None) => {
|
| 103 |
+
unreachable!("`ids` only reports what is present")
|
| 104 |
+
}
|
| 105 |
+
Err(clap::parser::MatchesError::UnknownArgument { .. }) => {
|
| 106 |
+
unreachable!("id came from matches")
|
| 107 |
+
}
|
| 108 |
+
Err(clap::parser::MatchesError::Downcast { .. }) => false,
|
| 109 |
+
Err(_) => {
|
| 110 |
+
unreachable!("id came from matches")
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
impl From<String> for Value {
|
| 117 |
+
fn from(other: String) -> Self {
|
| 118 |
+
Self::String(other)
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
impl From<bool> for Value {
|
| 123 |
+
fn from(other: bool) -> Self {
|
| 124 |
+
Self::Bool(other)
|
| 125 |
+
}
|
| 126 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git-derive.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
**This requires enabling the [`derive` feature flag][crate::_features].**
|
| 2 |
+
|
| 3 |
+
Git is an example of several common subcommand patterns.
|
| 4 |
+
|
| 5 |
+
Help:
|
| 6 |
+
```console
|
| 7 |
+
$ git-derive
|
| 8 |
+
? failed
|
| 9 |
+
A fictional versioning CLI
|
| 10 |
+
|
| 11 |
+
Usage: git-derive[EXE] <COMMAND>
|
| 12 |
+
|
| 13 |
+
Commands:
|
| 14 |
+
clone Clones repos
|
| 15 |
+
diff Compare two commits
|
| 16 |
+
push pushes things
|
| 17 |
+
add adds things
|
| 18 |
+
stash
|
| 19 |
+
help Print this message or the help of the given subcommand(s)
|
| 20 |
+
|
| 21 |
+
Options:
|
| 22 |
+
-h, --help Print help
|
| 23 |
+
|
| 24 |
+
$ git-derive help
|
| 25 |
+
A fictional versioning CLI
|
| 26 |
+
|
| 27 |
+
Usage: git-derive[EXE] <COMMAND>
|
| 28 |
+
|
| 29 |
+
Commands:
|
| 30 |
+
clone Clones repos
|
| 31 |
+
diff Compare two commits
|
| 32 |
+
push pushes things
|
| 33 |
+
add adds things
|
| 34 |
+
stash
|
| 35 |
+
help Print this message or the help of the given subcommand(s)
|
| 36 |
+
|
| 37 |
+
Options:
|
| 38 |
+
-h, --help Print help
|
| 39 |
+
|
| 40 |
+
$ git-derive help add
|
| 41 |
+
adds things
|
| 42 |
+
|
| 43 |
+
Usage: git-derive[EXE] add <PATH>...
|
| 44 |
+
|
| 45 |
+
Arguments:
|
| 46 |
+
<PATH>... Stuff to add
|
| 47 |
+
|
| 48 |
+
Options:
|
| 49 |
+
-h, --help Print help
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
A basic argument:
|
| 54 |
+
```console
|
| 55 |
+
$ git-derive add
|
| 56 |
+
? failed
|
| 57 |
+
adds things
|
| 58 |
+
|
| 59 |
+
Usage: git-derive[EXE] add <PATH>...
|
| 60 |
+
|
| 61 |
+
Arguments:
|
| 62 |
+
<PATH>... Stuff to add
|
| 63 |
+
|
| 64 |
+
Options:
|
| 65 |
+
-h, --help Print help
|
| 66 |
+
|
| 67 |
+
$ git-derive add Cargo.toml Cargo.lock
|
| 68 |
+
Adding ["Cargo.toml", "Cargo.lock"]
|
| 69 |
+
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Default subcommand:
|
| 73 |
+
```console
|
| 74 |
+
$ git-derive stash -h
|
| 75 |
+
Usage: git-derive[EXE] stash [OPTIONS]
|
| 76 |
+
git-derive[EXE] stash push [OPTIONS]
|
| 77 |
+
git-derive[EXE] stash pop [STASH]
|
| 78 |
+
git-derive[EXE] stash apply [STASH]
|
| 79 |
+
git-derive[EXE] stash help [COMMAND]...
|
| 80 |
+
|
| 81 |
+
Options:
|
| 82 |
+
-m, --message <MESSAGE>
|
| 83 |
+
-h, --help Print help
|
| 84 |
+
|
| 85 |
+
git-derive[EXE] stash push:
|
| 86 |
+
-m, --message <MESSAGE>
|
| 87 |
+
-h, --help Print help
|
| 88 |
+
|
| 89 |
+
git-derive[EXE] stash pop:
|
| 90 |
+
-h, --help Print help
|
| 91 |
+
[STASH]
|
| 92 |
+
|
| 93 |
+
git-derive[EXE] stash apply:
|
| 94 |
+
-h, --help Print help
|
| 95 |
+
[STASH]
|
| 96 |
+
|
| 97 |
+
git-derive[EXE] stash help:
|
| 98 |
+
Print this message or the help of the given subcommand(s)
|
| 99 |
+
[COMMAND]... Print help for the subcommand(s)
|
| 100 |
+
|
| 101 |
+
$ git-derive stash push -h
|
| 102 |
+
Usage: git-derive[EXE] stash push [OPTIONS]
|
| 103 |
+
|
| 104 |
+
Options:
|
| 105 |
+
-m, --message <MESSAGE>
|
| 106 |
+
-h, --help Print help
|
| 107 |
+
|
| 108 |
+
$ git-derive stash pop -h
|
| 109 |
+
Usage: git-derive[EXE] stash pop [STASH]
|
| 110 |
+
|
| 111 |
+
Arguments:
|
| 112 |
+
[STASH]
|
| 113 |
+
|
| 114 |
+
Options:
|
| 115 |
+
-h, --help Print help
|
| 116 |
+
|
| 117 |
+
$ git-derive stash -m "Prototype"
|
| 118 |
+
Pushing StashPushArgs { message: Some("Prototype") }
|
| 119 |
+
|
| 120 |
+
$ git-derive stash pop
|
| 121 |
+
Popping None
|
| 122 |
+
|
| 123 |
+
$ git-derive stash push -m "Prototype"
|
| 124 |
+
Pushing StashPushArgs { message: Some("Prototype") }
|
| 125 |
+
|
| 126 |
+
$ git-derive stash pop
|
| 127 |
+
Popping None
|
| 128 |
+
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
External subcommands:
|
| 132 |
+
```console
|
| 133 |
+
$ git-derive custom-tool arg1 --foo bar
|
| 134 |
+
Calling out to "custom-tool" with ["arg1", "--foo", "bar"]
|
| 135 |
+
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
Last argument:
|
| 139 |
+
```console
|
| 140 |
+
$ git-derive diff --help
|
| 141 |
+
Compare two commits
|
| 142 |
+
|
| 143 |
+
Usage: git-derive[EXE] diff [OPTIONS] [COMMIT] [COMMIT] [-- <PATH>]
|
| 144 |
+
|
| 145 |
+
Arguments:
|
| 146 |
+
[COMMIT]
|
| 147 |
+
[COMMIT]
|
| 148 |
+
[PATH]
|
| 149 |
+
|
| 150 |
+
Options:
|
| 151 |
+
--color[=<WHEN>] [default: auto] [possible values: always, auto, never]
|
| 152 |
+
-h, --help Print help
|
| 153 |
+
|
| 154 |
+
$ git-derive diff
|
| 155 |
+
Diffing stage..worktree (color=auto)
|
| 156 |
+
|
| 157 |
+
$ git-derive diff ./src
|
| 158 |
+
Diffing stage..worktree ./src (color=auto)
|
| 159 |
+
|
| 160 |
+
$ git-derive diff HEAD ./src
|
| 161 |
+
Diffing HEAD..worktree ./src (color=auto)
|
| 162 |
+
|
| 163 |
+
$ git-derive diff HEAD~~ -- HEAD
|
| 164 |
+
Diffing HEAD~~..worktree HEAD (color=auto)
|
| 165 |
+
|
| 166 |
+
$ git-derive diff --color
|
| 167 |
+
Diffing stage..worktree (color=always)
|
| 168 |
+
|
| 169 |
+
$ git-derive diff --color=never
|
| 170 |
+
Diffing stage..worktree (color=never)
|
| 171 |
+
|
| 172 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git-derive.rs
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::ffi::OsStr;
|
| 2 |
+
use std::ffi::OsString;
|
| 3 |
+
use std::path::PathBuf;
|
| 4 |
+
|
| 5 |
+
use clap::{Args, Parser, Subcommand, ValueEnum};
|
| 6 |
+
|
| 7 |
+
/// A fictional versioning CLI
|
| 8 |
+
#[derive(Debug, Parser)] // requires `derive` feature
|
| 9 |
+
#[command(name = "git")]
|
| 10 |
+
#[command(about = "A fictional versioning CLI", long_about = None)]
|
| 11 |
+
struct Cli {
|
| 12 |
+
#[command(subcommand)]
|
| 13 |
+
command: Commands,
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
#[derive(Debug, Subcommand)]
|
| 17 |
+
enum Commands {
|
| 18 |
+
/// Clones repos
|
| 19 |
+
#[command(arg_required_else_help = true)]
|
| 20 |
+
Clone {
|
| 21 |
+
/// The remote to clone
|
| 22 |
+
remote: String,
|
| 23 |
+
},
|
| 24 |
+
/// Compare two commits
|
| 25 |
+
Diff {
|
| 26 |
+
#[arg(value_name = "COMMIT")]
|
| 27 |
+
base: Option<OsString>,
|
| 28 |
+
#[arg(value_name = "COMMIT")]
|
| 29 |
+
head: Option<OsString>,
|
| 30 |
+
#[arg(last = true)]
|
| 31 |
+
path: Option<OsString>,
|
| 32 |
+
#[arg(
|
| 33 |
+
long,
|
| 34 |
+
require_equals = true,
|
| 35 |
+
value_name = "WHEN",
|
| 36 |
+
num_args = 0..=1,
|
| 37 |
+
default_value_t = ColorWhen::Auto,
|
| 38 |
+
default_missing_value = "always",
|
| 39 |
+
value_enum
|
| 40 |
+
)]
|
| 41 |
+
color: ColorWhen,
|
| 42 |
+
},
|
| 43 |
+
/// pushes things
|
| 44 |
+
#[command(arg_required_else_help = true)]
|
| 45 |
+
Push {
|
| 46 |
+
/// The remote to target
|
| 47 |
+
remote: String,
|
| 48 |
+
},
|
| 49 |
+
/// adds things
|
| 50 |
+
#[command(arg_required_else_help = true)]
|
| 51 |
+
Add {
|
| 52 |
+
/// Stuff to add
|
| 53 |
+
#[arg(required = true)]
|
| 54 |
+
path: Vec<PathBuf>,
|
| 55 |
+
},
|
| 56 |
+
Stash(StashArgs),
|
| 57 |
+
#[command(external_subcommand)]
|
| 58 |
+
External(Vec<OsString>),
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
#[derive(ValueEnum, Copy, Clone, Debug, PartialEq, Eq)]
|
| 62 |
+
enum ColorWhen {
|
| 63 |
+
Always,
|
| 64 |
+
Auto,
|
| 65 |
+
Never,
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
impl std::fmt::Display for ColorWhen {
|
| 69 |
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
| 70 |
+
self.to_possible_value()
|
| 71 |
+
.expect("no values are skipped")
|
| 72 |
+
.get_name()
|
| 73 |
+
.fmt(f)
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
#[derive(Debug, Args)]
|
| 78 |
+
#[command(args_conflicts_with_subcommands = true)]
|
| 79 |
+
#[command(flatten_help = true)]
|
| 80 |
+
struct StashArgs {
|
| 81 |
+
#[command(subcommand)]
|
| 82 |
+
command: Option<StashCommands>,
|
| 83 |
+
|
| 84 |
+
#[command(flatten)]
|
| 85 |
+
push: StashPushArgs,
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
#[derive(Debug, Subcommand)]
|
| 89 |
+
enum StashCommands {
|
| 90 |
+
Push(StashPushArgs),
|
| 91 |
+
Pop { stash: Option<String> },
|
| 92 |
+
Apply { stash: Option<String> },
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
#[derive(Debug, Args)]
|
| 96 |
+
struct StashPushArgs {
|
| 97 |
+
#[arg(short, long)]
|
| 98 |
+
message: Option<String>,
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
fn main() {
|
| 102 |
+
let args = Cli::parse();
|
| 103 |
+
|
| 104 |
+
match args.command {
|
| 105 |
+
Commands::Clone { remote } => {
|
| 106 |
+
println!("Cloning {remote}");
|
| 107 |
+
}
|
| 108 |
+
Commands::Diff {
|
| 109 |
+
mut base,
|
| 110 |
+
mut head,
|
| 111 |
+
mut path,
|
| 112 |
+
color,
|
| 113 |
+
} => {
|
| 114 |
+
if path.is_none() {
|
| 115 |
+
path = head;
|
| 116 |
+
head = None;
|
| 117 |
+
if path.is_none() {
|
| 118 |
+
path = base;
|
| 119 |
+
base = None;
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
let base = base
|
| 123 |
+
.as_deref()
|
| 124 |
+
.map(|s| s.to_str().unwrap())
|
| 125 |
+
.unwrap_or("stage");
|
| 126 |
+
let head = head
|
| 127 |
+
.as_deref()
|
| 128 |
+
.map(|s| s.to_str().unwrap())
|
| 129 |
+
.unwrap_or("worktree");
|
| 130 |
+
let path = path.as_deref().unwrap_or_else(|| OsStr::new(""));
|
| 131 |
+
println!(
|
| 132 |
+
"Diffing {}..{} {} (color={})",
|
| 133 |
+
base,
|
| 134 |
+
head,
|
| 135 |
+
path.to_string_lossy(),
|
| 136 |
+
color
|
| 137 |
+
);
|
| 138 |
+
}
|
| 139 |
+
Commands::Push { remote } => {
|
| 140 |
+
println!("Pushing to {remote}");
|
| 141 |
+
}
|
| 142 |
+
Commands::Add { path } => {
|
| 143 |
+
println!("Adding {path:?}");
|
| 144 |
+
}
|
| 145 |
+
Commands::Stash(stash) => {
|
| 146 |
+
let stash_cmd = stash.command.unwrap_or(StashCommands::Push(stash.push));
|
| 147 |
+
match stash_cmd {
|
| 148 |
+
StashCommands::Push(push) => {
|
| 149 |
+
println!("Pushing {push:?}");
|
| 150 |
+
}
|
| 151 |
+
StashCommands::Pop { stash } => {
|
| 152 |
+
println!("Popping {stash:?}");
|
| 153 |
+
}
|
| 154 |
+
StashCommands::Apply { stash } => {
|
| 155 |
+
println!("Applying {stash:?}");
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
Commands::External(args) => {
|
| 160 |
+
println!("Calling out to {:?} with {:?}", &args[0], &args[1..]);
|
| 161 |
+
}
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
// Continued program logic goes here...
|
| 165 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Git is an example of several common subcommand patterns.
|
| 2 |
+
|
| 3 |
+
Help:
|
| 4 |
+
```console
|
| 5 |
+
$ git
|
| 6 |
+
? failed
|
| 7 |
+
A fictional versioning CLI
|
| 8 |
+
|
| 9 |
+
Usage: git[EXE] <COMMAND>
|
| 10 |
+
|
| 11 |
+
Commands:
|
| 12 |
+
clone Clones repos
|
| 13 |
+
diff Compare two commits
|
| 14 |
+
push pushes things
|
| 15 |
+
add adds things
|
| 16 |
+
stash
|
| 17 |
+
help Print this message or the help of the given subcommand(s)
|
| 18 |
+
|
| 19 |
+
Options:
|
| 20 |
+
-h, --help Print help
|
| 21 |
+
|
| 22 |
+
$ git help
|
| 23 |
+
A fictional versioning CLI
|
| 24 |
+
|
| 25 |
+
Usage: git[EXE] <COMMAND>
|
| 26 |
+
|
| 27 |
+
Commands:
|
| 28 |
+
clone Clones repos
|
| 29 |
+
diff Compare two commits
|
| 30 |
+
push pushes things
|
| 31 |
+
add adds things
|
| 32 |
+
stash
|
| 33 |
+
help Print this message or the help of the given subcommand(s)
|
| 34 |
+
|
| 35 |
+
Options:
|
| 36 |
+
-h, --help Print help
|
| 37 |
+
|
| 38 |
+
$ git help add
|
| 39 |
+
adds things
|
| 40 |
+
|
| 41 |
+
Usage: git[EXE] add <PATH>...
|
| 42 |
+
|
| 43 |
+
Arguments:
|
| 44 |
+
<PATH>... Stuff to add
|
| 45 |
+
|
| 46 |
+
Options:
|
| 47 |
+
-h, --help Print help
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
A basic argument:
|
| 52 |
+
```console
|
| 53 |
+
$ git add
|
| 54 |
+
? failed
|
| 55 |
+
adds things
|
| 56 |
+
|
| 57 |
+
Usage: git[EXE] add <PATH>...
|
| 58 |
+
|
| 59 |
+
Arguments:
|
| 60 |
+
<PATH>... Stuff to add
|
| 61 |
+
|
| 62 |
+
Options:
|
| 63 |
+
-h, --help Print help
|
| 64 |
+
|
| 65 |
+
$ git add Cargo.toml Cargo.lock
|
| 66 |
+
Adding ["Cargo.toml", "Cargo.lock"]
|
| 67 |
+
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
Default subcommand:
|
| 71 |
+
```console
|
| 72 |
+
$ git stash -h
|
| 73 |
+
Usage: git[EXE] stash [OPTIONS]
|
| 74 |
+
git[EXE] stash push [OPTIONS]
|
| 75 |
+
git[EXE] stash pop [STASH]
|
| 76 |
+
git[EXE] stash apply [STASH]
|
| 77 |
+
git[EXE] stash help [COMMAND]...
|
| 78 |
+
|
| 79 |
+
Options:
|
| 80 |
+
-m, --message <MESSAGE>
|
| 81 |
+
-h, --help Print help
|
| 82 |
+
|
| 83 |
+
git[EXE] stash push:
|
| 84 |
+
-m, --message <MESSAGE>
|
| 85 |
+
-h, --help Print help
|
| 86 |
+
|
| 87 |
+
git[EXE] stash pop:
|
| 88 |
+
-h, --help Print help
|
| 89 |
+
[STASH]
|
| 90 |
+
|
| 91 |
+
git[EXE] stash apply:
|
| 92 |
+
-h, --help Print help
|
| 93 |
+
[STASH]
|
| 94 |
+
|
| 95 |
+
git[EXE] stash help:
|
| 96 |
+
Print this message or the help of the given subcommand(s)
|
| 97 |
+
[COMMAND]... Print help for the subcommand(s)
|
| 98 |
+
|
| 99 |
+
$ git stash push -h
|
| 100 |
+
Usage: git[EXE] stash push [OPTIONS]
|
| 101 |
+
|
| 102 |
+
Options:
|
| 103 |
+
-m, --message <MESSAGE>
|
| 104 |
+
-h, --help Print help
|
| 105 |
+
|
| 106 |
+
$ git stash pop -h
|
| 107 |
+
Usage: git[EXE] stash pop [STASH]
|
| 108 |
+
|
| 109 |
+
Arguments:
|
| 110 |
+
[STASH]
|
| 111 |
+
|
| 112 |
+
Options:
|
| 113 |
+
-h, --help Print help
|
| 114 |
+
|
| 115 |
+
$ git stash -m "Prototype"
|
| 116 |
+
Pushing Some("Prototype")
|
| 117 |
+
|
| 118 |
+
$ git stash pop
|
| 119 |
+
Popping None
|
| 120 |
+
|
| 121 |
+
$ git stash push -m "Prototype"
|
| 122 |
+
Pushing Some("Prototype")
|
| 123 |
+
|
| 124 |
+
$ git stash pop
|
| 125 |
+
Popping None
|
| 126 |
+
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
External subcommands:
|
| 130 |
+
```console
|
| 131 |
+
$ git custom-tool arg1 --foo bar
|
| 132 |
+
Calling out to "custom-tool" with ["arg1", "--foo", "bar"]
|
| 133 |
+
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
Last argument:
|
| 137 |
+
```console
|
| 138 |
+
$ git diff --help
|
| 139 |
+
Compare two commits
|
| 140 |
+
|
| 141 |
+
Usage: git[EXE] diff [OPTIONS] [COMMIT] [COMMIT] [-- <PATH>]
|
| 142 |
+
|
| 143 |
+
Arguments:
|
| 144 |
+
[COMMIT]
|
| 145 |
+
[COMMIT]
|
| 146 |
+
[PATH]
|
| 147 |
+
|
| 148 |
+
Options:
|
| 149 |
+
--color[=<WHEN>] [default: auto] [possible values: always, auto, never]
|
| 150 |
+
-h, --help Print help
|
| 151 |
+
|
| 152 |
+
$ git diff
|
| 153 |
+
Diffing stage..worktree (color=auto)
|
| 154 |
+
|
| 155 |
+
$ git diff ./src
|
| 156 |
+
Diffing stage..worktree ./src (color=auto)
|
| 157 |
+
|
| 158 |
+
$ git diff HEAD ./src
|
| 159 |
+
Diffing HEAD..worktree ./src (color=auto)
|
| 160 |
+
|
| 161 |
+
$ git diff HEAD~~ -- HEAD
|
| 162 |
+
Diffing HEAD~~..worktree HEAD (color=auto)
|
| 163 |
+
|
| 164 |
+
$ git diff --color
|
| 165 |
+
Diffing stage..worktree (color=always)
|
| 166 |
+
|
| 167 |
+
$ git diff --color=never
|
| 168 |
+
Diffing stage..worktree (color=never)
|
| 169 |
+
|
| 170 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/git.rs
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::ffi::OsString;
|
| 2 |
+
use std::path::PathBuf;
|
| 3 |
+
|
| 4 |
+
use clap::{arg, Command};
|
| 5 |
+
|
| 6 |
+
fn cli() -> Command {
|
| 7 |
+
Command::new("git")
|
| 8 |
+
.about("A fictional versioning CLI")
|
| 9 |
+
.subcommand_required(true)
|
| 10 |
+
.arg_required_else_help(true)
|
| 11 |
+
.allow_external_subcommands(true)
|
| 12 |
+
.subcommand(
|
| 13 |
+
Command::new("clone")
|
| 14 |
+
.about("Clones repos")
|
| 15 |
+
.arg(arg!(<REMOTE> "The remote to clone"))
|
| 16 |
+
.arg_required_else_help(true),
|
| 17 |
+
)
|
| 18 |
+
.subcommand(
|
| 19 |
+
Command::new("diff")
|
| 20 |
+
.about("Compare two commits")
|
| 21 |
+
.arg(arg!(base: [COMMIT]))
|
| 22 |
+
.arg(arg!(head: [COMMIT]))
|
| 23 |
+
.arg(arg!(path: [PATH]).last(true))
|
| 24 |
+
.arg(
|
| 25 |
+
arg!(--color <WHEN>)
|
| 26 |
+
.value_parser(["always", "auto", "never"])
|
| 27 |
+
.num_args(0..=1)
|
| 28 |
+
.require_equals(true)
|
| 29 |
+
.default_value("auto")
|
| 30 |
+
.default_missing_value("always"),
|
| 31 |
+
),
|
| 32 |
+
)
|
| 33 |
+
.subcommand(
|
| 34 |
+
Command::new("push")
|
| 35 |
+
.about("pushes things")
|
| 36 |
+
.arg(arg!(<REMOTE> "The remote to target"))
|
| 37 |
+
.arg_required_else_help(true),
|
| 38 |
+
)
|
| 39 |
+
.subcommand(
|
| 40 |
+
Command::new("add")
|
| 41 |
+
.about("adds things")
|
| 42 |
+
.arg_required_else_help(true)
|
| 43 |
+
.arg(arg!(<PATH> ... "Stuff to add").value_parser(clap::value_parser!(PathBuf))),
|
| 44 |
+
)
|
| 45 |
+
.subcommand(
|
| 46 |
+
Command::new("stash")
|
| 47 |
+
.args_conflicts_with_subcommands(true)
|
| 48 |
+
.flatten_help(true)
|
| 49 |
+
.args(push_args())
|
| 50 |
+
.subcommand(Command::new("push").args(push_args()))
|
| 51 |
+
.subcommand(Command::new("pop").arg(arg!([STASH])))
|
| 52 |
+
.subcommand(Command::new("apply").arg(arg!([STASH]))),
|
| 53 |
+
)
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
fn push_args() -> Vec<clap::Arg> {
|
| 57 |
+
vec![arg!(-m --message <MESSAGE>)]
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
fn main() {
|
| 61 |
+
let matches = cli().get_matches();
|
| 62 |
+
|
| 63 |
+
match matches.subcommand() {
|
| 64 |
+
Some(("clone", sub_matches)) => {
|
| 65 |
+
println!(
|
| 66 |
+
"Cloning {}",
|
| 67 |
+
sub_matches.get_one::<String>("REMOTE").expect("required")
|
| 68 |
+
);
|
| 69 |
+
}
|
| 70 |
+
Some(("diff", sub_matches)) => {
|
| 71 |
+
let color = sub_matches
|
| 72 |
+
.get_one::<String>("color")
|
| 73 |
+
.map(|s| s.as_str())
|
| 74 |
+
.expect("defaulted in clap");
|
| 75 |
+
|
| 76 |
+
let mut base = sub_matches.get_one::<String>("base").map(|s| s.as_str());
|
| 77 |
+
let mut head = sub_matches.get_one::<String>("head").map(|s| s.as_str());
|
| 78 |
+
let mut path = sub_matches.get_one::<String>("path").map(|s| s.as_str());
|
| 79 |
+
if path.is_none() {
|
| 80 |
+
path = head;
|
| 81 |
+
head = None;
|
| 82 |
+
if path.is_none() {
|
| 83 |
+
path = base;
|
| 84 |
+
base = None;
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
let base = base.unwrap_or("stage");
|
| 88 |
+
let head = head.unwrap_or("worktree");
|
| 89 |
+
let path = path.unwrap_or("");
|
| 90 |
+
println!("Diffing {base}..{head} {path} (color={color})");
|
| 91 |
+
}
|
| 92 |
+
Some(("push", sub_matches)) => {
|
| 93 |
+
println!(
|
| 94 |
+
"Pushing to {}",
|
| 95 |
+
sub_matches.get_one::<String>("REMOTE").expect("required")
|
| 96 |
+
);
|
| 97 |
+
}
|
| 98 |
+
Some(("add", sub_matches)) => {
|
| 99 |
+
let paths = sub_matches
|
| 100 |
+
.get_many::<PathBuf>("PATH")
|
| 101 |
+
.into_iter()
|
| 102 |
+
.flatten()
|
| 103 |
+
.collect::<Vec<_>>();
|
| 104 |
+
println!("Adding {paths:?}");
|
| 105 |
+
}
|
| 106 |
+
Some(("stash", sub_matches)) => {
|
| 107 |
+
let stash_command = sub_matches.subcommand().unwrap_or(("push", sub_matches));
|
| 108 |
+
match stash_command {
|
| 109 |
+
("apply", sub_matches) => {
|
| 110 |
+
let stash = sub_matches.get_one::<String>("STASH");
|
| 111 |
+
println!("Applying {stash:?}");
|
| 112 |
+
}
|
| 113 |
+
("pop", sub_matches) => {
|
| 114 |
+
let stash = sub_matches.get_one::<String>("STASH");
|
| 115 |
+
println!("Popping {stash:?}");
|
| 116 |
+
}
|
| 117 |
+
("push", sub_matches) => {
|
| 118 |
+
let message = sub_matches.get_one::<String>("message");
|
| 119 |
+
println!("Pushing {message:?}");
|
| 120 |
+
}
|
| 121 |
+
(name, _) => {
|
| 122 |
+
unreachable!("Unsupported subcommand `{name}`")
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
Some((ext, sub_matches)) => {
|
| 127 |
+
let args = sub_matches
|
| 128 |
+
.get_many::<OsString>("")
|
| 129 |
+
.into_iter()
|
| 130 |
+
.flatten()
|
| 131 |
+
.collect::<Vec<_>>();
|
| 132 |
+
println!("Calling out to {ext:?} with {args:?}");
|
| 133 |
+
}
|
| 134 |
+
_ => unreachable!(), // If all subcommands are defined above, anything else is unreachable!()
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
// Continued program logic goes here...
|
| 138 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-busybox.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
See the documentation for [`Command::multicall`][crate::Command::multicall] for rationale.
|
| 2 |
+
|
| 3 |
+
This example omits every command except true and false,
|
| 4 |
+
which are the most trivial to implement,
|
| 5 |
+
```console
|
| 6 |
+
$ busybox true
|
| 7 |
+
? 0
|
| 8 |
+
|
| 9 |
+
$ busybox false
|
| 10 |
+
? 1
|
| 11 |
+
|
| 12 |
+
```
|
| 13 |
+
*Note: without the links setup, we can't demonstrate the multicall behavior*
|
| 14 |
+
|
| 15 |
+
But includes the `--install` option as an example of why it can be useful
|
| 16 |
+
for the main program to take arguments that aren't applet subcommands.
|
| 17 |
+
```console
|
| 18 |
+
$ busybox --install
|
| 19 |
+
? failed
|
| 20 |
+
...
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
Though users must pass something:
|
| 25 |
+
```console
|
| 26 |
+
$ busybox
|
| 27 |
+
? failed
|
| 28 |
+
Usage: busybox [OPTIONS] [APPLET]
|
| 29 |
+
|
| 30 |
+
APPLETS:
|
| 31 |
+
true does nothing successfully
|
| 32 |
+
false does nothing unsuccessfully
|
| 33 |
+
help Print this message or the help of the given subcommand(s)
|
| 34 |
+
|
| 35 |
+
Options:
|
| 36 |
+
--install <install> Install hardlinks for all subcommands in path
|
| 37 |
+
-h, --help Print help
|
| 38 |
+
|
| 39 |
+
```
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-busybox.rs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::path::PathBuf;
|
| 2 |
+
use std::process::exit;
|
| 3 |
+
|
| 4 |
+
use clap::{value_parser, Arg, ArgAction, Command};
|
| 5 |
+
|
| 6 |
+
fn applet_commands() -> [Command; 2] {
|
| 7 |
+
[
|
| 8 |
+
Command::new("true").about("does nothing successfully"),
|
| 9 |
+
Command::new("false").about("does nothing unsuccessfully"),
|
| 10 |
+
]
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
fn main() {
|
| 14 |
+
let cmd = Command::new(env!("CARGO_CRATE_NAME"))
|
| 15 |
+
.multicall(true)
|
| 16 |
+
.subcommand(
|
| 17 |
+
Command::new("busybox")
|
| 18 |
+
.arg_required_else_help(true)
|
| 19 |
+
.subcommand_value_name("APPLET")
|
| 20 |
+
.subcommand_help_heading("APPLETS")
|
| 21 |
+
.arg(
|
| 22 |
+
Arg::new("install")
|
| 23 |
+
.long("install")
|
| 24 |
+
.help("Install hardlinks for all subcommands in path")
|
| 25 |
+
.exclusive(true)
|
| 26 |
+
.action(ArgAction::Set)
|
| 27 |
+
.default_missing_value("/usr/local/bin")
|
| 28 |
+
.value_parser(value_parser!(PathBuf)),
|
| 29 |
+
)
|
| 30 |
+
.subcommands(applet_commands()),
|
| 31 |
+
)
|
| 32 |
+
.subcommands(applet_commands());
|
| 33 |
+
|
| 34 |
+
let matches = cmd.get_matches();
|
| 35 |
+
let mut subcommand = matches.subcommand();
|
| 36 |
+
if let Some(("busybox", cmd)) = subcommand {
|
| 37 |
+
if cmd.contains_id("install") {
|
| 38 |
+
unimplemented!("Make hardlinks to the executable here");
|
| 39 |
+
}
|
| 40 |
+
subcommand = cmd.subcommand();
|
| 41 |
+
}
|
| 42 |
+
match subcommand {
|
| 43 |
+
Some(("false", _)) => exit(1),
|
| 44 |
+
Some(("true", _)) => exit(0),
|
| 45 |
+
_ => unreachable!("parser should ensure only valid subcommand names are used"),
|
| 46 |
+
}
|
| 47 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-hostname.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
See the documentation for [`Command::multicall`][crate::Command::multicall] for rationale.
|
| 2 |
+
|
| 3 |
+
This example omits the implementation of displaying address config
|
| 4 |
+
|
| 5 |
+
```console
|
| 6 |
+
$ hostname
|
| 7 |
+
www
|
| 8 |
+
|
| 9 |
+
```
|
| 10 |
+
*Note: without the links setup, we can't demonstrate the multicall behavior*
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/multicall-hostname.rs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::Command;
|
| 2 |
+
|
| 3 |
+
fn main() {
|
| 4 |
+
let cmd = Command::new(env!("CARGO_CRATE_NAME"))
|
| 5 |
+
.multicall(true)
|
| 6 |
+
.arg_required_else_help(true)
|
| 7 |
+
.subcommand_value_name("APPLET")
|
| 8 |
+
.subcommand_help_heading("APPLETS")
|
| 9 |
+
.subcommand(Command::new("hostname").about("show hostname part of FQDN"))
|
| 10 |
+
.subcommand(Command::new("dnsdomainname").about("show domain name part of FQDN"));
|
| 11 |
+
|
| 12 |
+
match cmd.get_matches().subcommand_name() {
|
| 13 |
+
Some("hostname") => println!("www"),
|
| 14 |
+
Some("dnsdomainname") => println!("example.com"),
|
| 15 |
+
_ => unreachable!("parser should ensure only valid subcommand names are used"),
|
| 16 |
+
}
|
| 17 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/pacman.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[`pacman`](https://wiki.archlinux.org/index.php/pacman) defines subcommands via flags.
|
| 2 |
+
|
| 3 |
+
Here, `-S` is a short flag subcommand:
|
| 4 |
+
```console
|
| 5 |
+
$ pacman -S package
|
| 6 |
+
Installing package...
|
| 7 |
+
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
Here `--sync` is a long flag subcommand:
|
| 11 |
+
```console
|
| 12 |
+
$ pacman --sync package
|
| 13 |
+
Installing package...
|
| 14 |
+
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
Now the short flag subcommand (`-S`) with a long flag:
|
| 18 |
+
```console
|
| 19 |
+
$ pacman -S --search name
|
| 20 |
+
Searching for name...
|
| 21 |
+
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
And the various forms of short flags that work:
|
| 25 |
+
```console
|
| 26 |
+
$ pacman -S -s name
|
| 27 |
+
Searching for name...
|
| 28 |
+
|
| 29 |
+
$ pacman -Ss name
|
| 30 |
+
Searching for name...
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
*(users can "stack" short subcommands with short flags or with other short flag subcommands)*
|
| 34 |
+
|
| 35 |
+
In the help, this looks like:
|
| 36 |
+
```console
|
| 37 |
+
$ pacman -h
|
| 38 |
+
package manager utility
|
| 39 |
+
|
| 40 |
+
Usage: pacman[EXE] <COMMAND>
|
| 41 |
+
|
| 42 |
+
Commands:
|
| 43 |
+
query, -Q, --query Query the package database.
|
| 44 |
+
sync, -S, --sync Synchronize packages.
|
| 45 |
+
help Print this message or the help of the given subcommand(s)
|
| 46 |
+
|
| 47 |
+
Options:
|
| 48 |
+
-h, --help Print help
|
| 49 |
+
-V, --version Print version
|
| 50 |
+
|
| 51 |
+
$ pacman -S -h
|
| 52 |
+
Synchronize packages.
|
| 53 |
+
|
| 54 |
+
Usage: pacman[EXE] {sync|--sync|-S} [OPTIONS] [package]...
|
| 55 |
+
|
| 56 |
+
Arguments:
|
| 57 |
+
[package]... packages
|
| 58 |
+
|
| 59 |
+
Options:
|
| 60 |
+
-s, --search <search>... search remote repositories for matching strings
|
| 61 |
+
-i, --info view package information
|
| 62 |
+
-h, --help Print help
|
| 63 |
+
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
And errors:
|
| 67 |
+
```console
|
| 68 |
+
$ pacman -S -s foo -i bar
|
| 69 |
+
? failed
|
| 70 |
+
error: the argument '--search <search>...' cannot be used with '--info'
|
| 71 |
+
|
| 72 |
+
Usage: pacman[EXE] {sync|--sync|-S} --search <search>... <package>...
|
| 73 |
+
|
| 74 |
+
For more information, try '--help'.
|
| 75 |
+
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
<div class="warning">
|
| 79 |
+
|
| 80 |
+
**NOTE:** Keep in mind that subcommands, flags, and long flags are *case sensitive*: `-Q` and `-q` are different flags/subcommands. For example, you can have both `-Q` subcommand and `-q` flag, and they will be properly disambiguated.
|
| 81 |
+
Let's make a quick program to illustrate.
|
| 82 |
+
|
| 83 |
+
</div>
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/pacman.rs
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use clap::{Arg, ArgAction, Command};
|
| 2 |
+
|
| 3 |
+
fn main() {
|
| 4 |
+
let matches = Command::new("pacman")
|
| 5 |
+
.about("package manager utility")
|
| 6 |
+
.version("5.2.1")
|
| 7 |
+
.subcommand_required(true)
|
| 8 |
+
.arg_required_else_help(true)
|
| 9 |
+
// Query subcommand
|
| 10 |
+
//
|
| 11 |
+
// Only a few of its arguments are implemented below.
|
| 12 |
+
.subcommand(
|
| 13 |
+
Command::new("query")
|
| 14 |
+
.short_flag('Q')
|
| 15 |
+
.long_flag("query")
|
| 16 |
+
.about("Query the package database.")
|
| 17 |
+
.arg(
|
| 18 |
+
Arg::new("search")
|
| 19 |
+
.short('s')
|
| 20 |
+
.long("search")
|
| 21 |
+
.help("search locally installed packages for matching strings")
|
| 22 |
+
.conflicts_with("info")
|
| 23 |
+
.action(ArgAction::Set)
|
| 24 |
+
.num_args(1..),
|
| 25 |
+
)
|
| 26 |
+
.arg(
|
| 27 |
+
Arg::new("info")
|
| 28 |
+
.long("info")
|
| 29 |
+
.short('i')
|
| 30 |
+
.conflicts_with("search")
|
| 31 |
+
.help("view package information")
|
| 32 |
+
.action(ArgAction::Set)
|
| 33 |
+
.num_args(1..),
|
| 34 |
+
),
|
| 35 |
+
)
|
| 36 |
+
// Sync subcommand
|
| 37 |
+
//
|
| 38 |
+
// Only a few of its arguments are implemented below.
|
| 39 |
+
.subcommand(
|
| 40 |
+
Command::new("sync")
|
| 41 |
+
.short_flag('S')
|
| 42 |
+
.long_flag("sync")
|
| 43 |
+
.about("Synchronize packages.")
|
| 44 |
+
.arg(
|
| 45 |
+
Arg::new("search")
|
| 46 |
+
.short('s')
|
| 47 |
+
.long("search")
|
| 48 |
+
.conflicts_with("info")
|
| 49 |
+
.action(ArgAction::Set)
|
| 50 |
+
.num_args(1..)
|
| 51 |
+
.help("search remote repositories for matching strings"),
|
| 52 |
+
)
|
| 53 |
+
.arg(
|
| 54 |
+
Arg::new("info")
|
| 55 |
+
.long("info")
|
| 56 |
+
.conflicts_with("search")
|
| 57 |
+
.short('i')
|
| 58 |
+
.action(ArgAction::SetTrue)
|
| 59 |
+
.help("view package information"),
|
| 60 |
+
)
|
| 61 |
+
.arg(
|
| 62 |
+
Arg::new("package")
|
| 63 |
+
.help("packages")
|
| 64 |
+
.required_unless_present("search")
|
| 65 |
+
.action(ArgAction::Set)
|
| 66 |
+
.num_args(1..),
|
| 67 |
+
),
|
| 68 |
+
)
|
| 69 |
+
.get_matches();
|
| 70 |
+
|
| 71 |
+
match matches.subcommand() {
|
| 72 |
+
Some(("sync", sync_matches)) => {
|
| 73 |
+
if sync_matches.contains_id("search") {
|
| 74 |
+
let packages: Vec<_> = sync_matches
|
| 75 |
+
.get_many::<String>("search")
|
| 76 |
+
.expect("contains_id")
|
| 77 |
+
.map(|s| s.as_str())
|
| 78 |
+
.collect();
|
| 79 |
+
let values = packages.join(", ");
|
| 80 |
+
println!("Searching for {values}...");
|
| 81 |
+
return;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
let packages: Vec<_> = sync_matches
|
| 85 |
+
.get_many::<String>("package")
|
| 86 |
+
.expect("is present")
|
| 87 |
+
.map(|s| s.as_str())
|
| 88 |
+
.collect();
|
| 89 |
+
let values = packages.join(", ");
|
| 90 |
+
|
| 91 |
+
if sync_matches.get_flag("info") {
|
| 92 |
+
println!("Retrieving info for {values}...");
|
| 93 |
+
} else {
|
| 94 |
+
println!("Installing {values}...");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Some(("query", query_matches)) => {
|
| 98 |
+
if let Some(packages) = query_matches.get_many::<String>("info") {
|
| 99 |
+
let comma_sep = packages.map(|s| s.as_str()).collect::<Vec<_>>().join(", ");
|
| 100 |
+
println!("Retrieving info for {comma_sep}...");
|
| 101 |
+
} else if let Some(queries) = query_matches.get_many::<String>("search") {
|
| 102 |
+
let comma_sep = queries.map(|s| s.as_str()).collect::<Vec<_>>().join(", ");
|
| 103 |
+
println!("Searching Locally for {comma_sep}...");
|
| 104 |
+
} else {
|
| 105 |
+
println!("Displaying all locally installed packages...");
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
_ => unreachable!(), // If all subcommands are defined above, anything else is unreachable
|
| 109 |
+
}
|
| 110 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/repl-derive.rs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::io::Write;
|
| 2 |
+
|
| 3 |
+
use clap::{Parser, Subcommand};
|
| 4 |
+
|
| 5 |
+
fn main() -> Result<(), String> {
|
| 6 |
+
loop {
|
| 7 |
+
let line = readline()?;
|
| 8 |
+
let line = line.trim();
|
| 9 |
+
if line.is_empty() {
|
| 10 |
+
continue;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
match respond(line) {
|
| 14 |
+
Ok(quit) => {
|
| 15 |
+
if quit {
|
| 16 |
+
break;
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
Err(err) => {
|
| 20 |
+
write!(std::io::stdout(), "{err}").map_err(|e| e.to_string())?;
|
| 21 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
Ok(())
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
fn respond(line: &str) -> Result<bool, String> {
|
| 30 |
+
let args = shlex::split(line).ok_or("error: Invalid quoting")?;
|
| 31 |
+
let cli = Cli::try_parse_from(args).map_err(|e| e.to_string())?;
|
| 32 |
+
match cli.command {
|
| 33 |
+
Commands::Ping => {
|
| 34 |
+
write!(std::io::stdout(), "Pong").map_err(|e| e.to_string())?;
|
| 35 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 36 |
+
}
|
| 37 |
+
Commands::Exit => {
|
| 38 |
+
write!(std::io::stdout(), "Exiting ...").map_err(|e| e.to_string())?;
|
| 39 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 40 |
+
return Ok(true);
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
Ok(false)
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
#[derive(Debug, Parser)]
|
| 47 |
+
#[command(multicall = true)]
|
| 48 |
+
struct Cli {
|
| 49 |
+
#[command(subcommand)]
|
| 50 |
+
command: Commands,
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
#[derive(Debug, Subcommand)]
|
| 54 |
+
enum Commands {
|
| 55 |
+
Ping,
|
| 56 |
+
Exit,
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
fn readline() -> Result<String, String> {
|
| 60 |
+
write!(std::io::stdout(), "$ ").map_err(|e| e.to_string())?;
|
| 61 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 62 |
+
let mut buffer = String::new();
|
| 63 |
+
std::io::stdin()
|
| 64 |
+
.read_line(&mut buffer)
|
| 65 |
+
.map_err(|e| e.to_string())?;
|
| 66 |
+
Ok(buffer)
|
| 67 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/repl.rs
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
use std::io::Write;
|
| 2 |
+
|
| 3 |
+
use clap::Command;
|
| 4 |
+
|
| 5 |
+
fn main() -> Result<(), String> {
|
| 6 |
+
loop {
|
| 7 |
+
let line = readline()?;
|
| 8 |
+
let line = line.trim();
|
| 9 |
+
if line.is_empty() {
|
| 10 |
+
continue;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
match respond(line) {
|
| 14 |
+
Ok(quit) => {
|
| 15 |
+
if quit {
|
| 16 |
+
break;
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
Err(err) => {
|
| 20 |
+
write!(std::io::stdout(), "{err}").map_err(|e| e.to_string())?;
|
| 21 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
Ok(())
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
fn respond(line: &str) -> Result<bool, String> {
|
| 30 |
+
let args = shlex::split(line).ok_or("error: Invalid quoting")?;
|
| 31 |
+
let matches = cli()
|
| 32 |
+
.try_get_matches_from(args)
|
| 33 |
+
.map_err(|e| e.to_string())?;
|
| 34 |
+
match matches.subcommand() {
|
| 35 |
+
Some(("ping", _matches)) => {
|
| 36 |
+
write!(std::io::stdout(), "Pong").map_err(|e| e.to_string())?;
|
| 37 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 38 |
+
}
|
| 39 |
+
Some(("quit", _matches)) => {
|
| 40 |
+
write!(std::io::stdout(), "Exiting ...").map_err(|e| e.to_string())?;
|
| 41 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 42 |
+
return Ok(true);
|
| 43 |
+
}
|
| 44 |
+
Some((name, _matches)) => unimplemented!("{name}"),
|
| 45 |
+
None => unreachable!("subcommand required"),
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
Ok(false)
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
fn cli() -> Command {
|
| 52 |
+
// strip out usage
|
| 53 |
+
const PARSER_TEMPLATE: &str = "\
|
| 54 |
+
{all-args}
|
| 55 |
+
";
|
| 56 |
+
// strip out name/version
|
| 57 |
+
const APPLET_TEMPLATE: &str = "\
|
| 58 |
+
{about-with-newline}\n\
|
| 59 |
+
{usage-heading}\n {usage}\n\
|
| 60 |
+
\n\
|
| 61 |
+
{all-args}{after-help}\
|
| 62 |
+
";
|
| 63 |
+
|
| 64 |
+
Command::new("repl")
|
| 65 |
+
.multicall(true)
|
| 66 |
+
.arg_required_else_help(true)
|
| 67 |
+
.subcommand_required(true)
|
| 68 |
+
.subcommand_value_name("APPLET")
|
| 69 |
+
.subcommand_help_heading("APPLETS")
|
| 70 |
+
.help_template(PARSER_TEMPLATE)
|
| 71 |
+
.subcommand(
|
| 72 |
+
Command::new("ping")
|
| 73 |
+
.about("Get a response")
|
| 74 |
+
.help_template(APPLET_TEMPLATE),
|
| 75 |
+
)
|
| 76 |
+
.subcommand(
|
| 77 |
+
Command::new("quit")
|
| 78 |
+
.alias("exit")
|
| 79 |
+
.about("Quit the REPL")
|
| 80 |
+
.help_template(APPLET_TEMPLATE),
|
| 81 |
+
)
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
fn readline() -> Result<String, String> {
|
| 85 |
+
write!(std::io::stdout(), "$ ").map_err(|e| e.to_string())?;
|
| 86 |
+
std::io::stdout().flush().map_err(|e| e.to_string())?;
|
| 87 |
+
let mut buffer = String::new();
|
| 88 |
+
std::io::stdin()
|
| 89 |
+
.read_line(&mut buffer)
|
| 90 |
+
.map_err(|e| e.to_string())?;
|
| 91 |
+
Ok(buffer)
|
| 92 |
+
}
|
.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap-4.5.60/examples/tutorial_builder/01_quick.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```console
|
| 2 |
+
$ 01_quick --help
|
| 3 |
+
A simple to use, efficient, and full-featured Command Line Argument Parser
|
| 4 |
+
|
| 5 |
+
Usage: 01_quick[EXE] [OPTIONS] [name] [COMMAND]
|
| 6 |
+
|
| 7 |
+
Commands:
|
| 8 |
+
test does testing things
|
| 9 |
+
help Print this message or the help of the given subcommand(s)
|
| 10 |
+
|
| 11 |
+
Arguments:
|
| 12 |
+
[name] Optional name to operate on
|
| 13 |
+
|
| 14 |
+
Options:
|
| 15 |
+
-c, --config <FILE> Sets a custom config file
|
| 16 |
+
-d, --debug... Turn debugging information on
|
| 17 |
+
-h, --help Print help
|
| 18 |
+
-V, --version Print version
|
| 19 |
+
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
By default, the program does nothing:
|
| 23 |
+
```console
|
| 24 |
+
$ 01_quick
|
| 25 |
+
Debug mode is off
|
| 26 |
+
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
But you can mix and match the various features
|
| 30 |
+
```console
|
| 31 |
+
$ 01_quick -dd test
|
| 32 |
+
Debug mode is on
|
| 33 |
+
Not printing testing lists...
|
| 34 |
+
|
| 35 |
+
```
|