mirror of
https://github.com/svenstaro/miniserve
synced 2024-07-03 08:08:47 +00:00
Upgrade clap to v4
This commit is contained in:
parent
5072d311d2
commit
978038a16e
204
Cargo.lock
generated
204
Cargo.lock
generated
|
@ -67,7 +67,7 @@ dependencies = [
|
|||
"http",
|
||||
"httparse",
|
||||
"httpdate",
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
"language-tags",
|
||||
"local-channel",
|
||||
"mime",
|
||||
|
@ -213,7 +213,7 @@ dependencies = [
|
|||
"futures-core",
|
||||
"futures-util",
|
||||
"http",
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
"language-tags",
|
||||
"log",
|
||||
"mime",
|
||||
|
@ -225,7 +225,7 @@ dependencies = [
|
|||
"serde_urlencoded",
|
||||
"smallvec",
|
||||
"socket2",
|
||||
"time 0.3.14",
|
||||
"time 0.3.15",
|
||||
"url",
|
||||
]
|
||||
|
||||
|
@ -529,36 +529,34 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "3.2.22"
|
||||
version = "4.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
|
||||
checksum = "6ea54a38e4bce14ff6931c72e5b3c43da7051df056913d4e7e1fcdb1c03df69d"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"bitflags",
|
||||
"clap_derive",
|
||||
"clap_lex",
|
||||
"indexmap",
|
||||
"once_cell",
|
||||
"strsim",
|
||||
"termcolor",
|
||||
"terminal_size",
|
||||
"textwrap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_complete"
|
||||
version = "3.2.5"
|
||||
version = "4.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8"
|
||||
checksum = "11cba7abac9b56dfe2f035098cdb3a43946f276e6db83b72c4e692343f9aab9a"
|
||||
dependencies = [
|
||||
"clap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_derive"
|
||||
version = "3.2.18"
|
||||
version = "4.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
|
||||
checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error",
|
||||
|
@ -569,18 +567,18 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_lex"
|
||||
version = "0.2.4"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
|
||||
checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
|
||||
dependencies = [
|
||||
"os_str_bytes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap_mangen"
|
||||
version = "0.1.11"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "105180c05a72388d5f5e4e4f6c79eecb92497bda749fa8f963a16647c5d5377f"
|
||||
checksum = "d5d5cd261a1d5601621a7ee4870f6e7f3f1ba3fc901d867f5201b36691e7efbe"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"roff",
|
||||
|
@ -592,6 +590,16 @@ version = "0.1.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9e769b5c8c8283982a987c6e948e540254f1058d5a74b8794914d4ef5fc2a24"
|
||||
|
||||
[[package]]
|
||||
name = "codespan-reporting"
|
||||
version = "0.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
|
||||
dependencies = [
|
||||
"termcolor",
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "comrak"
|
||||
version = "0.14.0"
|
||||
|
@ -642,12 +650,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.11"
|
||||
version = "0.8.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc"
|
||||
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -670,6 +677,50 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cxx"
|
||||
version = "1.0.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19f39818dcfc97d45b03953c1292efc4e80954e1583c4aa770bac1383e2310a4"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cxxbridge-flags",
|
||||
"cxxbridge-macro",
|
||||
"link-cplusplus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cxx-build"
|
||||
version = "1.0.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e580d70777c116df50c390d1211993f62d40302881e54d4b79727acb83d0199"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"codespan-reporting",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"scratch",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cxxbridge-flags"
|
||||
version = "1.0.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56a46460b88d1cec95112c8c363f0e2c39afdb237f60583b0b36343bf627ea9c"
|
||||
|
||||
[[package]]
|
||||
name = "cxxbridge-macro"
|
||||
version = "1.0.78"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "747b608fecf06b0d72d440f27acc99288207324b793be2c17991839f3d4995ea"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derive_more"
|
||||
version = "0.99.17"
|
||||
|
@ -1126,7 +1177,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
|
|||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1173,7 +1224,7 @@ dependencies = [
|
|||
"http-body",
|
||||
"httparse",
|
||||
"httpdate",
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
"pin-project-lite",
|
||||
"socket2",
|
||||
"tokio",
|
||||
|
@ -1197,17 +1248,28 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.50"
|
||||
version = "0.1.51"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0"
|
||||
checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"core-foundation-sys",
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone-haiku"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fde6edd6cef363e9359ed3c98ba64590ba9eecba2293eb5a723ab32aee8926aa"
|
||||
dependencies = [
|
||||
"cxx",
|
||||
"cxx-build",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.3.0"
|
||||
|
@ -1284,9 +1346,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
|
|||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
|
||||
checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
|
||||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
|
@ -1329,9 +1391,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.133"
|
||||
version = "0.2.135"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966"
|
||||
checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
|
||||
|
||||
[[package]]
|
||||
name = "libflate"
|
||||
|
@ -1353,6 +1415,15 @@ dependencies = [
|
|||
"rle-decode-fast",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "link-cplusplus"
|
||||
version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.0.46"
|
||||
|
@ -1520,7 +1591,6 @@ dependencies = [
|
|||
"simplelog",
|
||||
"socket2",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"tar",
|
||||
"thiserror",
|
||||
"url",
|
||||
|
@ -1689,9 +1759,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
|
|||
|
||||
[[package]]
|
||||
name = "pest"
|
||||
version = "2.3.1"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cb779fcf4bb850fbbb0edc96ff6cf34fd90c4b1a112ce042653280d9a7364048"
|
||||
checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
"ucd-trie",
|
||||
|
@ -1699,9 +1769,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pest_derive"
|
||||
version = "2.3.1"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "502b62a6d0245378b04ffe0a7fb4f4419a4815fce813bd8a0ec89a56e07d67b1"
|
||||
checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_generator",
|
||||
|
@ -1709,9 +1779,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pest_generator"
|
||||
version = "2.3.1"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "451e629bf49b750254da26132f1a5a9d11fd8a95a3df51d15c4abd1ba154cb6c"
|
||||
checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_meta",
|
||||
|
@ -1722,9 +1792,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pest_meta"
|
||||
version = "2.3.1"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bcec162c71c45e269dfc3fc2916eaeb97feab22993a21bcce4721d08cd7801a6"
|
||||
checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"pest",
|
||||
|
@ -1936,9 +2006,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.44"
|
||||
version = "1.0.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7bd7356a8122b6c4a24a82b278680c73357984ca2fc79a0f9fa6dea7dced7c58"
|
||||
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
@ -2248,6 +2318,12 @@ version = "1.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||
|
||||
[[package]]
|
||||
name = "scratch"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898"
|
||||
|
||||
[[package]]
|
||||
name = "sct"
|
||||
version = "0.7.0"
|
||||
|
@ -2297,11 +2373,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.85"
|
||||
version = "1.0.86"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
|
||||
checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074"
|
||||
dependencies = [
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
@ -2313,7 +2389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
|
||||
dependencies = [
|
||||
"form_urlencoded",
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
@ -2363,7 +2439,7 @@ checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786"
|
|||
dependencies = [
|
||||
"log",
|
||||
"termcolor",
|
||||
"time 0.3.14",
|
||||
"time 0.3.15",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2383,9 +2459,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.9.0"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
|
||||
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
|
@ -2440,6 +2516,9 @@ name = "strum"
|
|||
version = "0.24.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
|
||||
dependencies = [
|
||||
"strum_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
|
@ -2456,9 +2535,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.101"
|
||||
version = "1.0.102"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2"
|
||||
checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -2526,15 +2605,6 @@ version = "0.2.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b"
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
|
||||
dependencies = [
|
||||
"terminal_size",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.37"
|
||||
|
@ -2577,11 +2647,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.3.14"
|
||||
version = "0.3.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b"
|
||||
checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c"
|
||||
dependencies = [
|
||||
"itoa 1.0.3",
|
||||
"itoa 1.0.4",
|
||||
"libc",
|
||||
"num_threads",
|
||||
"time-macros",
|
||||
|
@ -2660,9 +2730,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
|
|||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.36"
|
||||
version = "0.1.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307"
|
||||
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"log",
|
||||
|
@ -2672,9 +2742,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.29"
|
||||
version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7"
|
||||
checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
]
|
||||
|
@ -2736,9 +2806,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
|
|||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.4"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
|
||||
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-normalization"
|
||||
|
@ -2749,6 +2819,12 @@ dependencies = [
|
|||
"tinyvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
|
||||
|
||||
[[package]]
|
||||
name = "unicode_categories"
|
||||
version = "0.1.1"
|
||||
|
|
|
@ -28,9 +28,9 @@ atty = "0.2"
|
|||
bytesize = "1"
|
||||
chrono = "0.4"
|
||||
chrono-humanize = "0.2"
|
||||
clap = { version = "3.2", features = ["derive", "cargo", "wrap_help"] }
|
||||
clap_complete = "3.2.3"
|
||||
clap_mangen = "0.1"
|
||||
clap = { version = "4", features = ["derive", "cargo", "wrap_help"] }
|
||||
clap_complete = "4"
|
||||
clap_mangen = "0.2"
|
||||
comrak = { version = "0.14", default-features = false }
|
||||
fast_qr = "0.5.1"
|
||||
futures = "0.3"
|
||||
|
@ -52,8 +52,7 @@ serde = { version = "1", features = ["derive"] }
|
|||
sha2 = "0.10"
|
||||
simplelog = "0.12"
|
||||
socket2 = "0.4"
|
||||
strum = "0.24"
|
||||
strum_macros = "0.24"
|
||||
strum = { version = "0.24", features = ["derive"] }
|
||||
tar = "0.4"
|
||||
thiserror = "1"
|
||||
yansi = "0.5"
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
|
|||
use actix_web::http::header::ContentEncoding;
|
||||
use libflate::gzip::Encoder;
|
||||
use serde::Deserialize;
|
||||
use strum_macros::{Display, EnumIter, EnumString};
|
||||
use strum::{Display, EnumIter, EnumString};
|
||||
use tar::Builder;
|
||||
use zip::{write, ZipWriter};
|
||||
|
||||
|
|
57
src/args.rs
57
src/args.rs
|
@ -1,15 +1,15 @@
|
|||
use std::net::IpAddr;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::{Parser, ValueHint};
|
||||
use clap::{Parser, ValueEnum, ValueHint};
|
||||
use clap_complete::Shell;
|
||||
use http::header::{HeaderMap, HeaderName, HeaderValue};
|
||||
|
||||
use crate::auth;
|
||||
use crate::errors::ContextualError;
|
||||
use crate::renderer;
|
||||
use crate::renderer::ThemeSlug;
|
||||
|
||||
#[derive(clap::ArgEnum, Clone)]
|
||||
#[derive(ValueEnum, Clone)]
|
||||
pub enum MediaType {
|
||||
Image,
|
||||
Audio,
|
||||
|
@ -24,14 +24,14 @@ pub struct CliArgs {
|
|||
pub verbose: bool,
|
||||
|
||||
/// Which path to serve
|
||||
#[clap(name = "PATH", parse(from_os_str), value_hint = ValueHint::AnyPath)]
|
||||
#[clap(name = "PATH", value_hint = ValueHint::AnyPath)]
|
||||
pub path: Option<PathBuf>,
|
||||
|
||||
/// The name of a directory index file to serve, like "index.html"
|
||||
///
|
||||
/// Normally, when miniserve serves a directory, it creates a listing for that directory.
|
||||
/// However, if a directory contains this file, miniserve will serve that file instead.
|
||||
#[clap(long, parse(from_os_str), name = "index_file", value_hint = ValueHint::FilePath)]
|
||||
#[clap(long, name = "index_file", value_hint = ValueHint::FilePath)]
|
||||
pub index: Option<PathBuf>,
|
||||
|
||||
/// Activate SPA (Single Page Application) mode
|
||||
|
@ -50,9 +50,8 @@ pub struct CliArgs {
|
|||
#[clap(
|
||||
short = 'i',
|
||||
long = "interfaces",
|
||||
parse(try_from_str = parse_interface),
|
||||
multiple_occurrences(true),
|
||||
number_of_values = 1,
|
||||
value_parser(parse_interface),
|
||||
num_args(1..),
|
||||
)]
|
||||
pub interfaces: Vec<IpAddr>,
|
||||
|
||||
|
@ -62,9 +61,8 @@ pub struct CliArgs {
|
|||
#[clap(
|
||||
short = 'a',
|
||||
long = "auth",
|
||||
parse(try_from_str = parse_auth),
|
||||
multiple_occurrences(true),
|
||||
number_of_values = 1,
|
||||
value_parser(parse_auth),
|
||||
num_args(1..)
|
||||
)]
|
||||
pub auth: Vec<auth::RequiredAuth>,
|
||||
|
||||
|
@ -73,7 +71,7 @@ pub struct CliArgs {
|
|||
pub route_prefix: Option<String>,
|
||||
|
||||
/// Generate a random 6-hexdigit route
|
||||
#[clap(long = "random-route", conflicts_with("route-prefix"))]
|
||||
#[clap(long = "random-route", conflicts_with("route_prefix"))]
|
||||
pub random_route: bool,
|
||||
|
||||
/// Hide symlinks in listing and prevent them from being followed
|
||||
|
@ -89,48 +87,41 @@ pub struct CliArgs {
|
|||
short = 'c',
|
||||
long = "color-scheme",
|
||||
default_value = "squirrel",
|
||||
possible_values = &*renderer::THEME_SLUGS,
|
||||
ignore_case = true,
|
||||
ignore_case = true
|
||||
)]
|
||||
pub color_scheme: String,
|
||||
pub color_scheme: ThemeSlug,
|
||||
|
||||
/// Default color scheme
|
||||
#[clap(
|
||||
short = 'd',
|
||||
long = "color-scheme-dark",
|
||||
default_value = "archlinux",
|
||||
possible_values = &*renderer::THEME_SLUGS,
|
||||
ignore_case = true,
|
||||
ignore_case = true
|
||||
)]
|
||||
pub color_scheme_dark: String,
|
||||
pub color_scheme_dark: ThemeSlug,
|
||||
|
||||
/// Enable QR code display
|
||||
#[clap(short = 'q', long = "qrcode")]
|
||||
pub qrcode: bool,
|
||||
|
||||
/// Enable file uploading (and optionally specify for which directory)
|
||||
#[clap(short = 'u', long = "upload-files", value_hint = ValueHint::FilePath, min_values = 0)]
|
||||
#[clap(short = 'u', long = "upload-files", value_hint = ValueHint::FilePath, num_args(0..=1), value_delimiter(','))]
|
||||
pub allowed_upload_dir: Option<Vec<PathBuf>>,
|
||||
|
||||
/// Enable creating directories
|
||||
#[clap(short = 'U', long = "mkdir", requires = "allowed-upload-dir")]
|
||||
#[clap(short = 'U', long = "mkdir", requires = "allowed_upload_dir")]
|
||||
pub mkdir_enabled: bool,
|
||||
|
||||
/// Specify uploadable media types
|
||||
#[clap(
|
||||
arg_enum,
|
||||
short = 'm',
|
||||
long = "media-type",
|
||||
requires = "allowed-upload-dir"
|
||||
)]
|
||||
#[clap(short = 'm', long = "media-type", requires = "allowed_upload_dir")]
|
||||
pub media_type: Option<Vec<MediaType>>,
|
||||
|
||||
/// Directly specify the uploadable media type expression
|
||||
#[clap(
|
||||
short = 'M',
|
||||
long = "raw-media-type",
|
||||
requires = "allowed-upload-dir",
|
||||
conflicts_with = "media-type"
|
||||
requires = "allowed_upload_dir",
|
||||
conflicts_with = "media_type"
|
||||
)]
|
||||
pub media_type_raw: Option<String>,
|
||||
|
||||
|
@ -164,8 +155,8 @@ pub struct CliArgs {
|
|||
/// Set custom header for responses
|
||||
#[clap(
|
||||
long = "header",
|
||||
parse(try_from_str = parse_header),
|
||||
multiple_occurrences(true),
|
||||
value_parser(parse_header),
|
||||
num_args(1..),
|
||||
number_of_values = 1
|
||||
)]
|
||||
pub header: Vec<HeaderMap>,
|
||||
|
@ -187,7 +178,7 @@ pub struct CliArgs {
|
|||
pub show_wget_footer: bool,
|
||||
|
||||
/// Generate completion file for a shell
|
||||
#[clap(long = "print-completions", value_name = "shell", arg_enum)]
|
||||
#[clap(long = "print-completions", value_name = "shell")]
|
||||
pub print_completions: Option<Shell>,
|
||||
|
||||
/// Generate man page
|
||||
|
@ -196,12 +187,12 @@ pub struct CliArgs {
|
|||
|
||||
/// TLS certificate to use
|
||||
#[cfg(feature = "tls")]
|
||||
#[clap(long = "tls-cert", requires = "tls-key", value_hint = ValueHint::FilePath)]
|
||||
#[clap(long = "tls-cert", requires = "tls_key", value_hint = ValueHint::FilePath)]
|
||||
pub tls_cert: Option<PathBuf>,
|
||||
|
||||
/// TLS private key to use
|
||||
#[cfg(feature = "tls")]
|
||||
#[clap(long = "tls-key", requires = "tls-cert", value_hint = ValueHint::FilePath)]
|
||||
#[clap(long = "tls-key", requires = "tls_cert", value_hint = ValueHint::FilePath)]
|
||||
pub tls_key: Option<PathBuf>,
|
||||
|
||||
/// Enable README.md rendering in directories
|
||||
|
|
|
@ -17,6 +17,7 @@ use crate::{
|
|||
args::{CliArgs, MediaType},
|
||||
auth::RequiredAuth,
|
||||
file_upload::sanitize_path,
|
||||
renderer::ThemeSlug,
|
||||
};
|
||||
|
||||
/// Possible characters for random routes
|
||||
|
@ -61,10 +62,10 @@ pub struct MiniserveConfig {
|
|||
pub css_route: String,
|
||||
|
||||
/// Default color scheme
|
||||
pub default_color_scheme: String,
|
||||
pub default_color_scheme: ThemeSlug,
|
||||
|
||||
/// Default dark mode color scheme
|
||||
pub default_color_scheme_dark: String,
|
||||
pub default_color_scheme_dark: ThemeSlug,
|
||||
|
||||
/// The name of a directory index file to serve, like "index.html"
|
||||
///
|
||||
|
|
|
@ -9,7 +9,7 @@ use comrak::{markdown_to_html, ComrakOptions};
|
|||
use percent_encoding::{percent_decode_str, utf8_percent_encode};
|
||||
use regex::Regex;
|
||||
use serde::Deserialize;
|
||||
use strum_macros::{Display, EnumString};
|
||||
use strum::{Display, EnumString};
|
||||
|
||||
use crate::archive::ArchiveMethod;
|
||||
use crate::auth::CurrentUser;
|
||||
|
|
|
@ -9,7 +9,7 @@ use actix_web::{
|
|||
};
|
||||
use actix_web_httpauth::middleware::HttpAuthentication;
|
||||
use anyhow::Result;
|
||||
use clap::{crate_version, IntoApp, Parser};
|
||||
use clap::{crate_version, CommandFactory, Parser};
|
||||
use fast_qr::QRBuilder;
|
||||
use log::{error, warn};
|
||||
use yansi::{Color, Paint};
|
||||
|
|
|
@ -3,10 +3,10 @@ use std::time::SystemTime;
|
|||
use actix_web::http::StatusCode;
|
||||
use chrono::{DateTime, Utc};
|
||||
use chrono_humanize::Humanize;
|
||||
use clap::{crate_name, crate_version};
|
||||
use clap::{crate_name, crate_version, ValueEnum};
|
||||
use fast_qr::{convert::svg::SvgBuilder, qr::QRCodeError, QRBuilder};
|
||||
use maud::{html, Markup, PreEscaped, DOCTYPE};
|
||||
use strum::IntoEnumIterator;
|
||||
use strum::{Display, IntoEnumIterator};
|
||||
|
||||
use crate::auth::CurrentUser;
|
||||
use crate::consts;
|
||||
|
@ -318,7 +318,17 @@ const THEME_PICKER_CHOICES: &[(&str, &str)] = &[
|
|||
("Monokai (dark)", "monokai"),
|
||||
];
|
||||
|
||||
pub const THEME_SLUGS: &[&str] = &["squirrel", "archlinux", "zenburn", "monokai"];
|
||||
#[derive(Debug, Clone, ValueEnum, Display)]
|
||||
pub enum ThemeSlug {
|
||||
#[strum(serialize = "squirrel")]
|
||||
Squirrel,
|
||||
#[strum(serialize = "archlinux")]
|
||||
Archlinux,
|
||||
#[strum(serialize = "zenburn")]
|
||||
Zenburn,
|
||||
#[strum(serialize = "monokai")]
|
||||
Monokai,
|
||||
}
|
||||
|
||||
/// Partial: qr code spoiler
|
||||
fn qr_spoiler(show_qrcode: bool, content: impl AsRef<str>) -> Markup {
|
||||
|
|
Loading…
Reference in New Issue
Block a user