Remove CLI help tests (#363)

Fixes #362

I've been working to remake the tests better / actually valuable but this is a quick "fix" for that issue... in any case help tests would have been gone anyway.
This commit is contained in:
Félix Saparelli 2022-07-01 13:39:43 +00:00
parent f548fd1956
commit f0d64f07df
5 changed files with 63 additions and 414 deletions

268
Cargo.lock generated
View File

@ -37,23 +37,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.57"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
[[package]]
name = "assert_cmd"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93ae1ddd39efd67689deb1979d80bad3bf7f2b09c6e6117c8d1f2443b5e2f83e"
dependencies = [
"bstr",
"doc-comment",
"predicates",
"predicates-core",
"predicates-tree",
"wait-timeout",
]
checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704"
[[package]]
name = "async-broadcast"
@ -214,9 +200,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "axum"
version = "0.5.7"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc47084705629d09d15060d70a8dbfce479c842303d05929ce29c74c995916ae"
checksum = "db018aeacdb84550c2c6c5a1c1f553f2a330294222f45c1dbe24f0b3d2320c01"
dependencies = [
"async-trait",
"axum-core",
@ -243,9 +229,9 @@ dependencies = [
[[package]]
name = "axum-core"
version = "0.2.5"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2efed1c501becea07ce48118786ebcf229531d0d3b28edf224a720020d9e106"
checksum = "cf4d047478b986f14a13edad31a009e2e05cb241f9805d0d75e4cba4e129ad4d"
dependencies = [
"async-trait",
"bytes",
@ -294,9 +280,7 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"lazy_static",
"memchr",
"regex-automata",
]
[[package]]
@ -337,15 +321,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "3.1.18"
version = "3.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b"
checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83"
dependencies = [
"atty",
"bitflags",
"clap_lex",
"indexmap",
"lazy_static",
"once_cell",
"strsim",
"termcolor",
"terminal_size",
@ -354,9 +338,9 @@ dependencies = [
[[package]]
name = "clap_lex"
version = "0.2.0"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
dependencies = [
"os_str_bytes",
]
@ -395,19 +379,6 @@ dependencies = [
"cache-padded",
]
[[package]]
name = "console"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
dependencies = [
"encode_unicode",
"libc",
"once_cell",
"terminal_size",
"winapi",
]
[[package]]
name = "console-api"
version = "0.3.0"
@ -455,9 +426,9 @@ dependencies = [
[[package]]
name = "crossbeam-channel"
version = "0.5.4"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53"
checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c"
dependencies = [
"cfg-if 1.0.0",
"crossbeam-utils",
@ -465,12 +436,12 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.8"
version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38"
checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83"
dependencies = [
"cfg-if 1.0.0",
"lazy_static",
"once_cell",
]
[[package]]
@ -484,12 +455,6 @@ dependencies = [
"syn",
]
[[package]]
name = "difflib"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
[[package]]
name = "dirs"
version = "2.0.2"
@ -541,12 +506,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "doc-comment"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "dunce"
version = "1.0.2"
@ -561,9 +520,9 @@ checksum = "6907e25393cdcc1f4f3f513d9aac1e840eb1cc341a0fccb01171f7d14d10b946"
[[package]]
name = "either"
version = "1.6.1"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
[[package]]
name = "embed-resource"
@ -578,12 +537,6 @@ dependencies = [
"winreg",
]
[[package]]
name = "encode_unicode"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
name = "enumflags2"
version = "0.7.5"
@ -796,13 +749,13 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.2.6"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [
"cfg-if 1.0.0",
"libc",
"wasi 0.10.2+wasi-snapshot-preview1",
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
@ -881,9 +834,9 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.11.2"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3"
[[package]]
name = "hdrhistogram"
@ -1039,9 +992,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.8.2"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [
"autocfg",
"hashbrown",
@ -1067,20 +1020,6 @@ dependencies = [
"libc",
]
[[package]]
name = "insta"
version = "1.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcc3e639bcba360d9237acabd22014c16f3df772db463b7446cd81b070714767"
dependencies = [
"console",
"once_cell",
"serde",
"serde_json",
"serde_yaml",
"similar",
]
[[package]]
name = "instant"
version = "0.1.12"
@ -1152,12 +1091,6 @@ dependencies = [
"cc",
]
[[package]]
name = "linked-hash-map"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]]
name = "lock_api"
version = "0.4.7"
@ -1179,9 +1112,9 @@ dependencies = [
[[package]]
name = "mac-notification-sys"
version = "0.5.0"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "297c13fc8ff9fa8b2d0e53850f80e0aa962628e865d447031ce58cdb062e5b29"
checksum = "042f74a606175d72ca483e14e0873fe0f6c003f7af45865b17b16fdaface7203"
dependencies = [
"cc",
"dirs-next",
@ -1292,9 +1225,9 @@ dependencies = [
[[package]]
name = "mio"
version = "0.8.3"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799"
checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf"
dependencies = [
"libc",
"log",
@ -1611,33 +1544,6 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
[[package]]
name = "predicates"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c"
dependencies = [
"difflib",
"itertools",
"predicates-core",
]
[[package]]
name = "predicates-core"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb"
[[package]]
name = "predicates-tree"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032"
dependencies = [
"predicates-core",
"termtree",
]
[[package]]
name = "proc-macro-crate"
version = "1.1.3"
@ -1650,9 +1556,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.39"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f"
checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
dependencies = [
"unicode-ident",
]
@ -1720,9 +1626,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
[[package]]
name = "quote"
version = "1.0.18"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
dependencies = [
"proc-macro2",
]
@ -1787,7 +1693,7 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
dependencies = [
"getrandom 0.2.6",
"getrandom 0.2.7",
]
[[package]]
@ -1823,7 +1729,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
"getrandom 0.2.6",
"getrandom 0.2.7",
"redox_syscall",
"thiserror",
]
@ -1901,9 +1807,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "semver"
version = "1.0.10"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41d061efea015927ac527063765e73601444cdc344ba855bc7bd44578b25e1c"
checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1"
[[package]]
name = "serde"
@ -1927,9 +1833,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.81"
version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
dependencies = [
"itoa",
"ryu",
@ -1947,18 +1853,6 @@ dependencies = [
"syn",
]
[[package]]
name = "serde_yaml"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707d15895415db6628332b737c838b88c598522e4dc70647e59b72312924aebc"
dependencies = [
"indexmap",
"ryu",
"serde",
"yaml-rust",
]
[[package]]
name = "sha1"
version = "0.6.1"
@ -1992,12 +1886,6 @@ dependencies = [
"libc",
]
[[package]]
name = "similar"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3"
[[package]]
name = "siphasher"
version = "0.3.10"
@ -2012,9 +1900,9 @@ checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32"
[[package]]
name = "smallvec"
version = "1.8.0"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]]
name = "smawk"
@ -2095,9 +1983,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.96"
version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf"
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
dependencies = [
"proc-macro2",
"quote",
@ -2168,12 +2056,6 @@ dependencies = [
"phf_codegen",
]
[[package]]
name = "termtree"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b"
[[package]]
name = "textwrap"
version = "0.15.0"
@ -2217,9 +2099,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.9"
version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd"
checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217"
dependencies = [
"libc",
"num_threads",
@ -2334,9 +2216,9 @@ dependencies = [
[[package]]
name = "tower"
version = "0.4.12"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a89fd63ad6adf737582df5db40d286574513c69a11dac5214dc3b5603d6713e"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
@ -2379,9 +2261,9 @@ checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62"
[[package]]
name = "tower-service"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
[[package]]
name = "tracing"
@ -2409,9 +2291,9 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.27"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921"
checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7"
dependencies = [
"once_cell",
"valuable",
@ -2502,9 +2384,9 @@ checksum = "63ec69f541d875b783ca40184d655f2927c95f0bffd486faa83cd3ac3529ec32"
[[package]]
name = "unicode-ident"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee"
checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c"
[[package]]
name = "unicode-linebreak"
@ -2565,15 +2447,6 @@ dependencies = [
"libc",
]
[[package]]
name = "wait-timeout"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
dependencies = [
"libc",
]
[[package]]
name = "waker-fn"
version = "1.1.0"
@ -2607,12 +2480,6 @@ version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@ -2646,7 +2513,6 @@ dependencies = [
name = "watchexec-cli"
version = "1.20.3"
dependencies = [
"assert_cmd",
"clap",
"console-subscriber",
"dirs 4.0.0",
@ -2654,7 +2520,6 @@ dependencies = [
"embed-resource",
"futures",
"ignore-files",
"insta",
"miette",
"mimalloc",
"notify-rust",
@ -2873,20 +2738,11 @@ version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]
[[package]]
name = "zbus"
version = "2.2.0"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53819092b9db813b2c6168b097b4b13ad284d81c9f2b0165a0a1b190e505a1f3"
checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b"
dependencies = [
"async-broadcast",
"async-channel",
@ -2898,6 +2754,7 @@ dependencies = [
"async-trait",
"byteorder",
"derivative",
"dirs 4.0.0",
"enumflags2",
"event-listener",
"futures-core",
@ -2913,6 +2770,7 @@ dependencies = [
"serde_repr",
"sha1",
"static_assertions",
"tracing",
"uds_windows",
"winapi",
"zbus_macros",
@ -2922,9 +2780,9 @@ dependencies = [
[[package]]
name = "zbus_macros"
version = "2.2.0"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7174ebe6722c280d6d132d694bb5664ce50a788cb70eeb518e7fc1ca095a114"
checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -2946,9 +2804,9 @@ dependencies = [
[[package]]
name = "zvariant"
version = "3.2.1"
version = "3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbd1abd8bc2c855412b9c8af9fc11c0d695c73c732ad5a1a1be10f3fd4bf19b2"
checksum = "cf2c71467724d4a77f0a1f0339dab10ca5d63f6a82411289cdcdfbfd47d2e407"
dependencies = [
"byteorder",
"enumflags2",
@ -2960,9 +2818,9 @@ dependencies = [
[[package]]
name = "zvariant_derive"
version = "3.2.1"
version = "3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abebd57382dfacf3e7bbdd7b7c3d162d6ed0687a78f046263ddef4ddabc275ae"
checksum = "2c47f3630ce926a03abf21f5a8db90c60c81ed71599b5c86ad1a54fd3c7564c5"
dependencies = [
"proc-macro-crate",
"proc-macro2",

View File

@ -80,10 +80,6 @@ mimalloc = "0.1.26"
[build-dependencies]
embed-resource = "1.6.1"
[dev-dependencies]
assert_cmd = "2.0.4"
insta = "1.10.0"
[features]
## For debugging only: enables the Tokio Console.
dev-console = ["console-subscriber"]

View File

@ -1,46 +0,0 @@
use std::process::Command;
use assert_cmd::prelude::*;
use insta::assert_snapshot;
#[test]
fn help() {
let output = Command::cargo_bin("watchexec")
.unwrap()
.arg("--help")
.output()
.unwrap();
assert!(output.status.success(), "--help returns 0");
assert_eq!(output.stderr, Vec::<u8>::new(), "--help stderr is empty");
assert_snapshot!(
if cfg!(windows) {
"help_windows"
} else {
"help_unix"
},
String::from_utf8(output.stdout).unwrap()
);
}
#[test]
fn help_short() {
let long = Command::cargo_bin("watchexec")
.unwrap()
.arg("--help")
.output()
.unwrap();
let short = Command::cargo_bin("watchexec")
.unwrap()
.arg("--help")
.output()
.unwrap();
assert!(short.status.success(), "-h returns 0");
assert_eq!(short.stderr, Vec::<u8>::new(), "-h stderr is empty");
assert_eq!(
long.stdout, short.stdout,
"--help and -h output are the same"
);
}

View File

@ -1,79 +0,0 @@
---
source: crates/cli/tests/help.rs
expression: "String::from_utf8(output.stdout).unwrap()"
---
⚠ DEBUG BUILD ⚠
watchexec 1.20.3
Execute commands when watched files change
USAGE:
watchexec [OPTIONS] <command>...
OPTIONS:
-h, --help Print help information
-V, --version Print version information
Command options:
-E, --env <name=value> Add an environment variable to the command
-n, --no-shell Do not wrap command in a shell. Deprecated: use --shell=none instead.
--no-environment Do not set WATCHEXEC_*_PATH environment variables for the command
--no-process-group Do not use a process group when running the command
--shell <shell> Use a different shell, or `none`. Defaults to `sh` (until 2.0, where
that will change to `$SHELL`). E.g. --shell=bash
--workdir <path> Change the working directory of the command
<command>... Command to execute
Filtering options:
-e, --exts <extensions> Comma-separated list of file extensions to watch (e.g.
js,css,html)
-f, --filter <pattern> Ignore all modifications except those matching the pattern
-i, --ignore <pattern> Ignore modifications to paths matching the pattern
--no-default-ignore Skip auto-ignoring of commonly ignored globs
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
--no-meta Ignore metadata changes
--no-project-ignore Skip auto-loading of project ignore files (.gitignore, .ignore,
etc)
--no-vcs-ignore Skip auto-loading of VCS (Git, etc) ignore files
--project-origin <path> Override the project origin: the directory from which ignore
files are detected
-w, --watch <path> Watch a specific file or directory
Output options:
-c, --clear Clear screen before executing command
-N, --notify Send a desktop notification when the command ends
Behaviour options:
-d, --debounce <milliseconds>
Set the timeout between detected change and command execution, defaults to 50ms
--delay-run <seconds>
Whenever starting the command, sleep some seconds first
--force-poll <interval>
Force polling mode (interval in milliseconds)
--on-busy-update <on-busy-update>
Select the behaviour to use when receiving events while the command is running. Current
default is queue, will change to do-nothing in 2.0. [possible values: do-nothing, queue,
restart, signal]
-p, --postpone
Wait until first change to execute command
-r, --restart
Restart the process if it's still running. Shorthand for --on-busy-update=restart
-s, --signal <signal>
Specify the signal to send when using --on-busy-update=signal
Debugging options:
--log-file <path> Write debugging messages to file in JSON format (use for bug reports)
--print-events Print events that trigger actions
-v, --verbose Print debugging messages (-v, -vv, -vvv, -vvvv; use -vvv for bug
reports)
Use @argfile as first argument to load arguments from the file `argfile` (one argument per line)
which will be inserted in place of the @argfile (further arguments on the CLI will override or add
onto those in the file).

View File

@ -1,80 +0,0 @@
---
source: crates/cli/tests/help.rs
assertion_line: 16
expression: "String::from_utf8(output.stdout).unwrap()"
---
⚠ DEBUG BUILD ⚠
watchexec 1.20.3
Execute commands when watched files change
USAGE:
watchexec.exe [OPTIONS] <command>...
OPTIONS:
-h, --help Print help information
-V, --version Print version information
Command options:
-E, --env <name=value> Add an environment variable to the command
-n, --no-shell Do not wrap command in a shell. Deprecated: use --shell=none instead.
--no-environment Do not set WATCHEXEC_*_PATH environment variables for the command
--no-process-group Do not use a process group when running the command
--shell <shell> Use a different shell, or `none`. Try --shell=powershell, which will
become the default in 2.0.
--workdir <path> Change the working directory of the command
<command>... Command to execute
Filtering options:
-e, --exts <extensions> Comma-separated list of file extensions to watch (e.g.
js,css,html)
-f, --filter <pattern> Ignore all modifications except those matching the pattern
-i, --ignore <pattern> Ignore modifications to paths matching the pattern
--no-default-ignore Skip auto-ignoring of commonly ignored globs
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
--no-meta Ignore metadata changes
--no-project-ignore Skip auto-loading of project ignore files (.gitignore, .ignore,
etc)
--no-vcs-ignore Skip auto-loading of VCS (Git, etc) ignore files
--project-origin <path> Override the project origin: the directory from which ignore
files are detected
-w, --watch <path> Watch a specific file or directory
Output options:
-c, --clear Clear screen before executing command
-N, --notify Send a desktop notification when the command ends
Behaviour options:
-d, --debounce <milliseconds>
Set the timeout between detected change and command execution, defaults to 50ms
--delay-run <seconds>
Whenever starting the command, sleep some seconds first
--force-poll <interval>
Force polling mode (interval in milliseconds)
--on-busy-update <on-busy-update>
Select the behaviour to use when receiving events while the command is running. Current
default is queue, will change to do-nothing in 2.0. [possible values: do-nothing, queue,
restart, signal]
-p, --postpone
Wait until first change to execute command
-r, --restart
Restart the process if it's still running. Shorthand for --on-busy-update=restart
-s, --signal <signal>
Specify the signal to send when using --on-busy-update=signal
Debugging options:
--log-file <path> Write debugging messages to file in JSON format (use for bug reports)
--print-events Print events that trigger actions
-v, --verbose Print debugging messages (-v, -vv, -vvv, -vvvv; use -vvv for bug
reports)
Use @argfile as first argument to load arguments from the file `argfile` (one argument per line)
which will be inserted in place of the @argfile (further arguments on the CLI will override or add
onto those in the file).