summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2023-11-13 15:21:25 +0100
committerFxQnLr <[email protected]>2023-11-13 15:21:25 +0100
commit93de8742961287cb9cfd08e68c8afa2347585a73 (patch)
tree8689660d75d0e45af460ed3d144b5a010289c0be
parent9957da9b182ca209ff8caa8f670d3bd7eff154bb (diff)
downloadwebol-cli-93de8742961287cb9cfd08e68c8afa2347585a73.tar
webol-cli-93de8742961287cb9cfd08e68c8afa2347585a73.tar.gz
webol-cli-93de8742961287cb9cfd08e68c8afa2347585a73.zip
add completion and cargo update
-rw-r--r--Cargo.lock200
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs17
3 files changed, 122 insertions, 96 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 3337e1e..5620d60 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
19 19
20[[package]] 20[[package]]
21name = "ahash" 21name = "ahash"
22version = "0.7.6" 22version = "0.7.7"
23source = "registry+https://github.com/rust-lang/crates.io-index" 23source = "registry+https://github.com/rust-lang/crates.io-index"
24checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 24checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd"
25dependencies = [ 25dependencies = [
26 "getrandom", 26 "getrandom",
27 "once_cell", 27 "once_cell",
@@ -116,9 +116,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
116 116
117[[package]] 117[[package]]
118name = "base64" 118name = "base64"
119version = "0.21.4" 119version = "0.21.5"
120source = "registry+https://github.com/rust-lang/crates.io-index" 120source = "registry+https://github.com/rust-lang/crates.io-index"
121checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" 121checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
122 122
123[[package]] 123[[package]]
124name = "bitflags" 124name = "bitflags"
@@ -161,9 +161,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
161 161
162[[package]] 162[[package]]
163name = "cc" 163name = "cc"
164version = "1.0.83" 164version = "1.0.84"
165source = "registry+https://github.com/rust-lang/crates.io-index" 165source = "registry+https://github.com/rust-lang/crates.io-index"
166checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 166checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856"
167dependencies = [ 167dependencies = [
168 "libc", 168 "libc",
169] 169]
@@ -176,9 +176,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
176 176
177[[package]] 177[[package]]
178name = "clap" 178name = "clap"
179version = "4.4.6" 179version = "4.4.8"
180source = "registry+https://github.com/rust-lang/crates.io-index" 180source = "registry+https://github.com/rust-lang/crates.io-index"
181checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" 181checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64"
182dependencies = [ 182dependencies = [
183 "clap_builder", 183 "clap_builder",
184 "clap_derive", 184 "clap_derive",
@@ -186,9 +186,9 @@ dependencies = [
186 186
187[[package]] 187[[package]]
188name = "clap_builder" 188name = "clap_builder"
189version = "4.4.6" 189version = "4.4.8"
190source = "registry+https://github.com/rust-lang/crates.io-index" 190source = "registry+https://github.com/rust-lang/crates.io-index"
191checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" 191checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc"
192dependencies = [ 192dependencies = [
193 "anstream", 193 "anstream",
194 "anstyle", 194 "anstyle",
@@ -197,10 +197,19 @@ dependencies = [
197] 197]
198 198
199[[package]] 199[[package]]
200name = "clap_complete"
201version = "4.4.4"
202source = "registry+https://github.com/rust-lang/crates.io-index"
203checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae"
204dependencies = [
205 "clap",
206]
207
208[[package]]
200name = "clap_derive" 209name = "clap_derive"
201version = "4.4.2" 210version = "4.4.7"
202source = "registry+https://github.com/rust-lang/crates.io-index" 211source = "registry+https://github.com/rust-lang/crates.io-index"
203checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" 212checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442"
204dependencies = [ 213dependencies = [
205 "heck", 214 "heck",
206 "proc-macro2", 215 "proc-macro2",
@@ -210,9 +219,9 @@ dependencies = [
210 219
211[[package]] 220[[package]]
212name = "clap_lex" 221name = "clap_lex"
213version = "0.5.1" 222version = "0.6.0"
214source = "registry+https://github.com/rust-lang/crates.io-index" 223source = "registry+https://github.com/rust-lang/crates.io-index"
215checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" 224checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
216 225
217[[package]] 226[[package]]
218name = "colorchoice" 227name = "colorchoice"
@@ -270,9 +279,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
270 279
271[[package]] 280[[package]]
272name = "cpufeatures" 281name = "cpufeatures"
273version = "0.2.10" 282version = "0.2.11"
274source = "registry+https://github.com/rust-lang/crates.io-index" 283source = "registry+https://github.com/rust-lang/crates.io-index"
275checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" 284checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
276dependencies = [ 285dependencies = [
277 "libc", 286 "libc",
278] 287]
@@ -347,9 +356,9 @@ dependencies = [
347 356
348[[package]] 357[[package]]
349name = "errno" 358name = "errno"
350version = "0.3.5" 359version = "0.3.6"
351source = "registry+https://github.com/rust-lang/crates.io-index" 360source = "registry+https://github.com/rust-lang/crates.io-index"
352checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" 361checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e"
353dependencies = [ 362dependencies = [
354 "libc", 363 "libc",
355 "windows-sys 0.48.0", 364 "windows-sys 0.48.0",
@@ -393,9 +402,9 @@ dependencies = [
393 402
394[[package]] 403[[package]]
395name = "futures-channel" 404name = "futures-channel"
396version = "0.3.28" 405version = "0.3.29"
397source = "registry+https://github.com/rust-lang/crates.io-index" 406source = "registry+https://github.com/rust-lang/crates.io-index"
398checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 407checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
399dependencies = [ 408dependencies = [
400 "futures-core", 409 "futures-core",
401] 410]
@@ -464,9 +473,9 @@ dependencies = [
464 473
465[[package]] 474[[package]]
466name = "getrandom" 475name = "getrandom"
467version = "0.2.10" 476version = "0.2.11"
468source = "registry+https://github.com/rust-lang/crates.io-index" 477source = "registry+https://github.com/rust-lang/crates.io-index"
469checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" 478checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
470dependencies = [ 479dependencies = [
471 "cfg-if", 480 "cfg-if",
472 "libc", 481 "libc",
@@ -521,9 +530,9 @@ checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
521 530
522[[package]] 531[[package]]
523name = "http" 532name = "http"
524version = "0.2.9" 533version = "0.2.10"
525source = "registry+https://github.com/rust-lang/crates.io-index" 534source = "registry+https://github.com/rust-lang/crates.io-index"
526checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 535checksum = "f95b9abcae896730d42b78e09c155ed4ddf82c07b4de772c64aee5b2d8b7c150"
527dependencies = [ 536dependencies = [
528 "bytes", 537 "bytes",
529 "fnv", 538 "fnv",
@@ -634,9 +643,9 @@ dependencies = [
634 643
635[[package]] 644[[package]]
636name = "ipnet" 645name = "ipnet"
637version = "2.8.0" 646version = "2.9.0"
638source = "registry+https://github.com/rust-lang/crates.io-index" 647source = "registry+https://github.com/rust-lang/crates.io-index"
639checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" 648checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3"
640 649
641[[package]] 650[[package]]
642name = "itoa" 651name = "itoa"
@@ -646,9 +655,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
646 655
647[[package]] 656[[package]]
648name = "js-sys" 657name = "js-sys"
649version = "0.3.64" 658version = "0.3.65"
650source = "registry+https://github.com/rust-lang/crates.io-index" 659source = "registry+https://github.com/rust-lang/crates.io-index"
651checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 660checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8"
652dependencies = [ 661dependencies = [
653 "wasm-bindgen", 662 "wasm-bindgen",
654] 663]
@@ -672,9 +681,20 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
672 681
673[[package]] 682[[package]]
674name = "libc" 683name = "libc"
675version = "0.2.149" 684version = "0.2.150"
685source = "registry+https://github.com/rust-lang/crates.io-index"
686checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
687
688[[package]]
689name = "libredox"
690version = "0.0.1"
676source = "registry+https://github.com/rust-lang/crates.io-index" 691source = "registry+https://github.com/rust-lang/crates.io-index"
677checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" 692checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
693dependencies = [
694 "bitflags 2.4.1",
695 "libc",
696 "redox_syscall",
697]
678 698
679[[package]] 699[[package]]
680name = "linked-hash-map" 700name = "linked-hash-map"
@@ -684,9 +704,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
684 704
685[[package]] 705[[package]]
686name = "linux-raw-sys" 706name = "linux-raw-sys"
687version = "0.4.10" 707version = "0.4.11"
688source = "registry+https://github.com/rust-lang/crates.io-index" 708source = "registry+https://github.com/rust-lang/crates.io-index"
689checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" 709checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829"
690 710
691[[package]] 711[[package]]
692name = "log" 712name = "log"
@@ -723,9 +743,9 @@ dependencies = [
723 743
724[[package]] 744[[package]]
725name = "mio" 745name = "mio"
726version = "0.8.8" 746version = "0.8.9"
727source = "registry+https://github.com/rust-lang/crates.io-index" 747source = "registry+https://github.com/rust-lang/crates.io-index"
728checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 748checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"
729dependencies = [ 749dependencies = [
730 "libc", 750 "libc",
731 "wasi", 751 "wasi",
@@ -793,9 +813,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
793 813
794[[package]] 814[[package]]
795name = "openssl" 815name = "openssl"
796version = "0.10.57" 816version = "0.10.59"
797source = "registry+https://github.com/rust-lang/crates.io-index" 817source = "registry+https://github.com/rust-lang/crates.io-index"
798checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" 818checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33"
799dependencies = [ 819dependencies = [
800 "bitflags 2.4.1", 820 "bitflags 2.4.1",
801 "cfg-if", 821 "cfg-if",
@@ -825,9 +845,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
825 845
826[[package]] 846[[package]]
827name = "openssl-sys" 847name = "openssl-sys"
828version = "0.9.93" 848version = "0.9.95"
829source = "registry+https://github.com/rust-lang/crates.io-index" 849source = "registry+https://github.com/rust-lang/crates.io-index"
830checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" 850checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9"
831dependencies = [ 851dependencies = [
832 "cc", 852 "cc",
833 "libc", 853 "libc",
@@ -865,9 +885,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
865 885
866[[package]] 886[[package]]
867name = "pest" 887name = "pest"
868version = "2.7.4" 888version = "2.7.5"
869source = "registry+https://github.com/rust-lang/crates.io-index" 889source = "registry+https://github.com/rust-lang/crates.io-index"
870checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" 890checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5"
871dependencies = [ 891dependencies = [
872 "memchr", 892 "memchr",
873 "thiserror", 893 "thiserror",
@@ -876,9 +896,9 @@ dependencies = [
876 896
877[[package]] 897[[package]]
878name = "pest_derive" 898name = "pest_derive"
879version = "2.7.4" 899version = "2.7.5"
880source = "registry+https://github.com/rust-lang/crates.io-index" 900source = "registry+https://github.com/rust-lang/crates.io-index"
881checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" 901checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2"
882dependencies = [ 902dependencies = [
883 "pest", 903 "pest",
884 "pest_generator", 904 "pest_generator",
@@ -886,9 +906,9 @@ dependencies = [
886 906
887[[package]] 907[[package]]
888name = "pest_generator" 908name = "pest_generator"
889version = "2.7.4" 909version = "2.7.5"
890source = "registry+https://github.com/rust-lang/crates.io-index" 910source = "registry+https://github.com/rust-lang/crates.io-index"
891checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" 911checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227"
892dependencies = [ 912dependencies = [
893 "pest", 913 "pest",
894 "pest_meta", 914 "pest_meta",
@@ -899,9 +919,9 @@ dependencies = [
899 919
900[[package]] 920[[package]]
901name = "pest_meta" 921name = "pest_meta"
902version = "2.7.4" 922version = "2.7.5"
903source = "registry+https://github.com/rust-lang/crates.io-index" 923source = "registry+https://github.com/rust-lang/crates.io-index"
904checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" 924checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6"
905dependencies = [ 925dependencies = [
906 "once_cell", 926 "once_cell",
907 "pest", 927 "pest",
@@ -988,30 +1008,21 @@ dependencies = [
988 1008
989[[package]] 1009[[package]]
990name = "redox_syscall" 1010name = "redox_syscall"
991version = "0.2.16" 1011version = "0.4.1"
992source = "registry+https://github.com/rust-lang/crates.io-index"
993checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
994dependencies = [
995 "bitflags 1.3.2",
996]
997
998[[package]]
999name = "redox_syscall"
1000version = "0.3.5"
1001source = "registry+https://github.com/rust-lang/crates.io-index" 1012source = "registry+https://github.com/rust-lang/crates.io-index"
1002checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 1013checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
1003dependencies = [ 1014dependencies = [
1004 "bitflags 1.3.2", 1015 "bitflags 1.3.2",
1005] 1016]
1006 1017
1007[[package]] 1018[[package]]
1008name = "redox_users" 1019name = "redox_users"
1009version = "0.4.3" 1020version = "0.4.4"
1010source = "registry+https://github.com/rust-lang/crates.io-index" 1021source = "registry+https://github.com/rust-lang/crates.io-index"
1011checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1022checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4"
1012dependencies = [ 1023dependencies = [
1013 "getrandom", 1024 "getrandom",
1014 "redox_syscall 0.2.16", 1025 "libredox",
1015 "thiserror", 1026 "thiserror",
1016] 1027]
1017 1028
@@ -1021,7 +1032,7 @@ version = "0.11.22"
1021source = "registry+https://github.com/rust-lang/crates.io-index" 1032source = "registry+https://github.com/rust-lang/crates.io-index"
1022checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" 1033checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b"
1023dependencies = [ 1034dependencies = [
1024 "base64 0.21.4", 1035 "base64 0.21.5",
1025 "bytes", 1036 "bytes",
1026 "encoding_rs", 1037 "encoding_rs",
1027 "futures-core", 1038 "futures-core",
@@ -1082,9 +1093,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
1082 1093
1083[[package]] 1094[[package]]
1084name = "rustix" 1095name = "rustix"
1085version = "0.38.20" 1096version = "0.38.21"
1086source = "registry+https://github.com/rust-lang/crates.io-index" 1097source = "registry+https://github.com/rust-lang/crates.io-index"
1087checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" 1098checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3"
1088dependencies = [ 1099dependencies = [
1089 "bitflags 2.4.1", 1100 "bitflags 2.4.1",
1090 "errno", 1101 "errno",
@@ -1133,18 +1144,18 @@ dependencies = [
1133 1144
1134[[package]] 1145[[package]]
1135name = "serde" 1146name = "serde"
1136version = "1.0.189" 1147version = "1.0.192"
1137source = "registry+https://github.com/rust-lang/crates.io-index" 1148source = "registry+https://github.com/rust-lang/crates.io-index"
1138checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" 1149checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
1139dependencies = [ 1150dependencies = [
1140 "serde_derive", 1151 "serde_derive",
1141] 1152]
1142 1153
1143[[package]] 1154[[package]]
1144name = "serde_derive" 1155name = "serde_derive"
1145version = "1.0.189" 1156version = "1.0.192"
1146source = "registry+https://github.com/rust-lang/crates.io-index" 1157source = "registry+https://github.com/rust-lang/crates.io-index"
1147checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" 1158checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
1148dependencies = [ 1159dependencies = [
1149 "proc-macro2", 1160 "proc-macro2",
1150 "quote", 1161 "quote",
@@ -1153,9 +1164,9 @@ dependencies = [
1153 1164
1154[[package]] 1165[[package]]
1155name = "serde_json" 1166name = "serde_json"
1156version = "1.0.107" 1167version = "1.0.108"
1157source = "registry+https://github.com/rust-lang/crates.io-index" 1168source = "registry+https://github.com/rust-lang/crates.io-index"
1158checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" 1169checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
1159dependencies = [ 1170dependencies = [
1160 "itoa", 1171 "itoa",
1161 "ryu", 1172 "ryu",
@@ -1233,9 +1244,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
1233 1244
1234[[package]] 1245[[package]]
1235name = "syn" 1246name = "syn"
1236version = "2.0.38" 1247version = "2.0.39"
1237source = "registry+https://github.com/rust-lang/crates.io-index" 1248source = "registry+https://github.com/rust-lang/crates.io-index"
1238checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" 1249checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
1239dependencies = [ 1250dependencies = [
1240 "proc-macro2", 1251 "proc-macro2",
1241 "quote", 1252 "quote",
@@ -1265,13 +1276,13 @@ dependencies = [
1265 1276
1266[[package]] 1277[[package]]
1267name = "tempfile" 1278name = "tempfile"
1268version = "3.8.0" 1279version = "3.8.1"
1269source = "registry+https://github.com/rust-lang/crates.io-index" 1280source = "registry+https://github.com/rust-lang/crates.io-index"
1270checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" 1281checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
1271dependencies = [ 1282dependencies = [
1272 "cfg-if", 1283 "cfg-if",
1273 "fastrand", 1284 "fastrand",
1274 "redox_syscall 0.3.5", 1285 "redox_syscall",
1275 "rustix", 1286 "rustix",
1276 "windows-sys 0.48.0", 1287 "windows-sys 0.48.0",
1277] 1288]
@@ -1313,9 +1324,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
1313 1324
1314[[package]] 1325[[package]]
1315name = "tokio" 1326name = "tokio"
1316version = "1.33.0" 1327version = "1.34.0"
1317source = "registry+https://github.com/rust-lang/crates.io-index" 1328source = "registry+https://github.com/rust-lang/crates.io-index"
1318checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" 1329checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
1319dependencies = [ 1330dependencies = [
1320 "backtrace", 1331 "backtrace",
1321 "bytes", 1332 "bytes",
@@ -1330,9 +1341,9 @@ dependencies = [
1330 1341
1331[[package]] 1342[[package]]
1332name = "tokio-macros" 1343name = "tokio-macros"
1333version = "2.1.0" 1344version = "2.2.0"
1334source = "registry+https://github.com/rust-lang/crates.io-index" 1345source = "registry+https://github.com/rust-lang/crates.io-index"
1335checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 1346checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
1336dependencies = [ 1347dependencies = [
1337 "proc-macro2", 1348 "proc-macro2",
1338 "quote", 1349 "quote",
@@ -1363,9 +1374,9 @@ dependencies = [
1363 1374
1364[[package]] 1375[[package]]
1365name = "tokio-util" 1376name = "tokio-util"
1366version = "0.7.9" 1377version = "0.7.10"
1367source = "registry+https://github.com/rust-lang/crates.io-index" 1378source = "registry+https://github.com/rust-lang/crates.io-index"
1368checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" 1379checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15"
1369dependencies = [ 1380dependencies = [
1370 "bytes", 1381 "bytes",
1371 "futures-core", 1382 "futures-core",
@@ -1525,9 +1536,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
1525 1536
1526[[package]] 1537[[package]]
1527name = "wasm-bindgen" 1538name = "wasm-bindgen"
1528version = "0.2.87" 1539version = "0.2.88"
1529source = "registry+https://github.com/rust-lang/crates.io-index" 1540source = "registry+https://github.com/rust-lang/crates.io-index"
1530checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 1541checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce"
1531dependencies = [ 1542dependencies = [
1532 "cfg-if", 1543 "cfg-if",
1533 "wasm-bindgen-macro", 1544 "wasm-bindgen-macro",
@@ -1535,9 +1546,9 @@ dependencies = [
1535 1546
1536[[package]] 1547[[package]]
1537name = "wasm-bindgen-backend" 1548name = "wasm-bindgen-backend"
1538version = "0.2.87" 1549version = "0.2.88"
1539source = "registry+https://github.com/rust-lang/crates.io-index" 1550source = "registry+https://github.com/rust-lang/crates.io-index"
1540checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 1551checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217"
1541dependencies = [ 1552dependencies = [
1542 "bumpalo", 1553 "bumpalo",
1543 "log", 1554 "log",
@@ -1550,9 +1561,9 @@ dependencies = [
1550 1561
1551[[package]] 1562[[package]]
1552name = "wasm-bindgen-futures" 1563name = "wasm-bindgen-futures"
1553version = "0.4.37" 1564version = "0.4.38"
1554source = "registry+https://github.com/rust-lang/crates.io-index" 1565source = "registry+https://github.com/rust-lang/crates.io-index"
1555checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 1566checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02"
1556dependencies = [ 1567dependencies = [
1557 "cfg-if", 1568 "cfg-if",
1558 "js-sys", 1569 "js-sys",
@@ -1562,9 +1573,9 @@ dependencies = [
1562 1573
1563[[package]] 1574[[package]]
1564name = "wasm-bindgen-macro" 1575name = "wasm-bindgen-macro"
1565version = "0.2.87" 1576version = "0.2.88"
1566source = "registry+https://github.com/rust-lang/crates.io-index" 1577source = "registry+https://github.com/rust-lang/crates.io-index"
1567checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 1578checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2"
1568dependencies = [ 1579dependencies = [
1569 "quote", 1580 "quote",
1570 "wasm-bindgen-macro-support", 1581 "wasm-bindgen-macro-support",
@@ -1572,9 +1583,9 @@ dependencies = [
1572 1583
1573[[package]] 1584[[package]]
1574name = "wasm-bindgen-macro-support" 1585name = "wasm-bindgen-macro-support"
1575version = "0.2.87" 1586version = "0.2.88"
1576source = "registry+https://github.com/rust-lang/crates.io-index" 1587source = "registry+https://github.com/rust-lang/crates.io-index"
1577checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 1588checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907"
1578dependencies = [ 1589dependencies = [
1579 "proc-macro2", 1590 "proc-macro2",
1580 "quote", 1591 "quote",
@@ -1585,15 +1596,15 @@ dependencies = [
1585 1596
1586[[package]] 1597[[package]]
1587name = "wasm-bindgen-shared" 1598name = "wasm-bindgen-shared"
1588version = "0.2.87" 1599version = "0.2.88"
1589source = "registry+https://github.com/rust-lang/crates.io-index" 1600source = "registry+https://github.com/rust-lang/crates.io-index"
1590checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 1601checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
1591 1602
1592[[package]] 1603[[package]]
1593name = "web-sys" 1604name = "web-sys"
1594version = "0.3.64" 1605version = "0.3.65"
1595source = "registry+https://github.com/rust-lang/crates.io-index" 1606source = "registry+https://github.com/rust-lang/crates.io-index"
1596checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 1607checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85"
1597dependencies = [ 1608dependencies = [
1598 "js-sys", 1609 "js-sys",
1599 "wasm-bindgen", 1610 "wasm-bindgen",
@@ -1604,6 +1615,7 @@ name = "webol-cli"
1604version = "0.1.0" 1615version = "0.1.0"
1605dependencies = [ 1616dependencies = [
1606 "clap", 1617 "clap",
1618 "clap_complete",
1607 "config", 1619 "config",
1608 "dirs", 1620 "dirs",
1609 "futures-util", 1621 "futures-util",
diff --git a/Cargo.toml b/Cargo.toml
index 2ea0f27..ca76349 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,6 +11,7 @@ path = "src/main.rs"
11 11
12[dependencies] 12[dependencies]
13clap = { version = "4.4.6", features = ["derive"] } 13clap = { version = "4.4.6", features = ["derive"] }
14clap_complete = "4.4.4"
14config = "0.13.3" 15config = "0.13.3"
15dirs = "5.0.1" 16dirs = "5.0.1"
16futures-util = "0.3.29" 17futures-util = "0.3.29"
diff --git a/src/main.rs b/src/main.rs
index 204e671..afe6fac 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,7 @@
1use std::{fmt::Display, time::Duration}; 1use std::{fmt::Display, time::Duration};
2 2
3use clap::{Parser, Subcommand}; 3use clap::{Parser, Command, CommandFactory, Subcommand};
4use clap_complete::{generate, Shell, Generator};
4use config::SETTINGS; 5use config::SETTINGS;
5use error::CliError; 6use error::CliError;
6use indicatif::{ProgressBar, ProgressStyle, MultiProgress}; 7use indicatif::{ProgressBar, ProgressStyle, MultiProgress};
@@ -39,7 +40,10 @@ enum Commands {
39 Device { 40 Device {
40 #[command(subcommand)] 41 #[command(subcommand)]
41 devicecmd: DeviceCmd, 42 devicecmd: DeviceCmd,
42 } 43 },
44 CliGen {
45 id: Shell,
46 },
43} 47}
44 48
45#[derive(Subcommand)] 49#[derive(Subcommand)]
@@ -81,12 +85,21 @@ async fn main() -> Result<(), CliError> {
81 device::post(id, mac, broadcast_addr, ip).await?; 85 device::post(id, mac, broadcast_addr, ip).await?;
82 }, 86 },
83 } 87 }
88 },
89 Commands::CliGen { id } => {
90 eprintln!("Generating completion file for {id:?}...");
91 let mut cmd = Args::command();
92 print_completions(id, &mut cmd)
84 } 93 }
85 } 94 }
86 95
87 Ok(()) 96 Ok(())
88} 97}
89 98
99fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
100 generate(gen, cmd, cmd.get_name().to_string(), &mut std::io::stdout());
101}
102
90fn default_headers() -> Result<HeaderMap, CliError> { 103fn default_headers() -> Result<HeaderMap, CliError> {
91 let mut map = HeaderMap::new(); 104 let mut map = HeaderMap::new();
92 map.append("Accept-Content", HeaderValue::from_str("application/json").unwrap()); 105 map.append("Accept-Content", HeaderValue::from_str("application/json").unwrap());