summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock130
-rw-r--r--src/input.rs17
2 files changed, 77 insertions, 70 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 08f103b..04f3139 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -24,9 +24,9 @@ dependencies = [
24 24
25[[package]] 25[[package]]
26name = "async-trait" 26name = "async-trait"
27version = "0.1.58" 27version = "0.1.59"
28source = "registry+https://github.com/rust-lang/crates.io-index" 28source = "registry+https://github.com/rust-lang/crates.io-index"
29checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" 29checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364"
30dependencies = [ 30dependencies = [
31 "proc-macro2", 31 "proc-macro2",
32 "quote", 32 "quote",
@@ -68,15 +68,15 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
68 68
69[[package]] 69[[package]]
70name = "bytes" 70name = "bytes"
71version = "1.2.1" 71version = "1.3.0"
72source = "registry+https://github.com/rust-lang/crates.io-index" 72source = "registry+https://github.com/rust-lang/crates.io-index"
73checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" 73checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
74 74
75[[package]] 75[[package]]
76name = "cc" 76name = "cc"
77version = "1.0.73" 77version = "1.0.77"
78source = "registry+https://github.com/rust-lang/crates.io-index" 78source = "registry+https://github.com/rust-lang/crates.io-index"
79checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 79checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
80 80
81[[package]] 81[[package]]
82name = "cfg-if" 82name = "cfg-if"
@@ -86,9 +86,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
86 86
87[[package]] 87[[package]]
88name = "chrono" 88name = "chrono"
89version = "0.4.22" 89version = "0.4.23"
90source = "registry+https://github.com/rust-lang/crates.io-index" 90source = "registry+https://github.com/rust-lang/crates.io-index"
91checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" 91checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
92dependencies = [ 92dependencies = [
93 "iana-time-zone", 93 "iana-time-zone",
94 "js-sys", 94 "js-sys",
@@ -111,9 +111,9 @@ dependencies = [
111 111
112[[package]] 112[[package]]
113name = "config" 113name = "config"
114version = "0.13.2" 114version = "0.13.3"
115source = "registry+https://github.com/rust-lang/crates.io-index" 115source = "registry+https://github.com/rust-lang/crates.io-index"
116checksum = "11f1667b8320afa80d69d8bbe40830df2c8a06003d86f73d8e003b2c48df416d" 116checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7"
117dependencies = [ 117dependencies = [
118 "async-trait", 118 "async-trait",
119 "json5", 119 "json5",
@@ -165,9 +165,9 @@ dependencies = [
165 165
166[[package]] 166[[package]]
167name = "cxx" 167name = "cxx"
168version = "1.0.80" 168version = "1.0.83"
169source = "registry+https://github.com/rust-lang/crates.io-index" 169source = "registry+https://github.com/rust-lang/crates.io-index"
170checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" 170checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf"
171dependencies = [ 171dependencies = [
172 "cc", 172 "cc",
173 "cxxbridge-flags", 173 "cxxbridge-flags",
@@ -177,9 +177,9 @@ dependencies = [
177 177
178[[package]] 178[[package]]
179name = "cxx-build" 179name = "cxx-build"
180version = "1.0.80" 180version = "1.0.83"
181source = "registry+https://github.com/rust-lang/crates.io-index" 181source = "registry+https://github.com/rust-lang/crates.io-index"
182checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" 182checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39"
183dependencies = [ 183dependencies = [
184 "cc", 184 "cc",
185 "codespan-reporting", 185 "codespan-reporting",
@@ -192,15 +192,15 @@ dependencies = [
192 192
193[[package]] 193[[package]]
194name = "cxxbridge-flags" 194name = "cxxbridge-flags"
195version = "1.0.80" 195version = "1.0.83"
196source = "registry+https://github.com/rust-lang/crates.io-index" 196source = "registry+https://github.com/rust-lang/crates.io-index"
197checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" 197checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12"
198 198
199[[package]] 199[[package]]
200name = "cxxbridge-macro" 200name = "cxxbridge-macro"
201version = "1.0.80" 201version = "1.0.83"
202source = "registry+https://github.com/rust-lang/crates.io-index" 202source = "registry+https://github.com/rust-lang/crates.io-index"
203checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" 203checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6"
204dependencies = [ 204dependencies = [
205 "proc-macro2", 205 "proc-macro2",
206 "quote", 206 "quote",
@@ -209,9 +209,9 @@ dependencies = [
209 209
210[[package]] 210[[package]]
211name = "digest" 211name = "digest"
212version = "0.10.5" 212version = "0.10.6"
213source = "registry+https://github.com/rust-lang/crates.io-index" 213source = "registry+https://github.com/rust-lang/crates.io-index"
214checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" 214checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
215dependencies = [ 215dependencies = [
216 "block-buffer", 216 "block-buffer",
217 "crypto-common", 217 "crypto-common",
@@ -438,9 +438,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
438 438
439[[package]] 439[[package]]
440name = "hyper" 440name = "hyper"
441version = "0.14.20" 441version = "0.14.23"
442source = "registry+https://github.com/rust-lang/crates.io-index" 442source = "registry+https://github.com/rust-lang/crates.io-index"
443checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" 443checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c"
444dependencies = [ 444dependencies = [
445 "bytes", 445 "bytes",
446 "futures-channel", 446 "futures-channel",
@@ -509,9 +509,9 @@ dependencies = [
509 509
510[[package]] 510[[package]]
511name = "indexmap" 511name = "indexmap"
512version = "1.9.1" 512version = "1.9.2"
513source = "registry+https://github.com/rust-lang/crates.io-index" 513source = "registry+https://github.com/rust-lang/crates.io-index"
514checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" 514checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
515dependencies = [ 515dependencies = [
516 "autocfg", 516 "autocfg",
517 "hashbrown", 517 "hashbrown",
@@ -528,9 +528,9 @@ dependencies = [
528 528
529[[package]] 529[[package]]
530name = "ipnet" 530name = "ipnet"
531version = "2.5.0" 531version = "2.5.1"
532source = "registry+https://github.com/rust-lang/crates.io-index" 532source = "registry+https://github.com/rust-lang/crates.io-index"
533checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" 533checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745"
534 534
535[[package]] 535[[package]]
536name = "itoa" 536name = "itoa"
@@ -566,9 +566,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
566 566
567[[package]] 567[[package]]
568name = "libc" 568name = "libc"
569version = "0.2.137" 569version = "0.2.138"
570source = "registry+https://github.com/rust-lang/crates.io-index" 570source = "registry+https://github.com/rust-lang/crates.io-index"
571checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" 571checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8"
572 572
573[[package]] 573[[package]]
574name = "libsqlite3-sys" 574name = "libsqlite3-sys"
@@ -661,9 +661,9 @@ dependencies = [
661 661
662[[package]] 662[[package]]
663name = "native-tls" 663name = "native-tls"
664version = "0.2.10" 664version = "0.2.11"
665source = "registry+https://github.com/rust-lang/crates.io-index" 665source = "registry+https://github.com/rust-lang/crates.io-index"
666checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" 666checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
667dependencies = [ 667dependencies = [
668 "lazy_static", 668 "lazy_static",
669 "libc", 669 "libc",
@@ -708,9 +708,9 @@ dependencies = [
708 708
709[[package]] 709[[package]]
710name = "num_cpus" 710name = "num_cpus"
711version = "1.13.1" 711version = "1.14.0"
712source = "registry+https://github.com/rust-lang/crates.io-index" 712source = "registry+https://github.com/rust-lang/crates.io-index"
713checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 713checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
714dependencies = [ 714dependencies = [
715 "hermit-abi", 715 "hermit-abi",
716 "libc", 716 "libc",
@@ -724,9 +724,9 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
724 724
725[[package]] 725[[package]]
726name = "openssl" 726name = "openssl"
727version = "0.10.42" 727version = "0.10.44"
728source = "registry+https://github.com/rust-lang/crates.io-index" 728source = "registry+https://github.com/rust-lang/crates.io-index"
729checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" 729checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566"
730dependencies = [ 730dependencies = [
731 "bitflags", 731 "bitflags",
732 "cfg-if", 732 "cfg-if",
@@ -756,9 +756,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
756 756
757[[package]] 757[[package]]
758name = "openssl-sys" 758name = "openssl-sys"
759version = "0.9.77" 759version = "0.9.79"
760source = "registry+https://github.com/rust-lang/crates.io-index" 760source = "registry+https://github.com/rust-lang/crates.io-index"
761checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" 761checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4"
762dependencies = [ 762dependencies = [
763 "autocfg", 763 "autocfg",
764 "cc", 764 "cc",
@@ -789,9 +789,9 @@ dependencies = [
789 789
790[[package]] 790[[package]]
791name = "parking_lot_core" 791name = "parking_lot_core"
792version = "0.9.4" 792version = "0.9.5"
793source = "registry+https://github.com/rust-lang/crates.io-index" 793source = "registry+https://github.com/rust-lang/crates.io-index"
794checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" 794checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba"
795dependencies = [ 795dependencies = [
796 "cfg-if", 796 "cfg-if",
797 "libc", 797 "libc",
@@ -814,9 +814,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
814 814
815[[package]] 815[[package]]
816name = "pest" 816name = "pest"
817version = "2.4.0" 817version = "2.5.1"
818source = "registry+https://github.com/rust-lang/crates.io-index" 818source = "registry+https://github.com/rust-lang/crates.io-index"
819checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" 819checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0"
820dependencies = [ 820dependencies = [
821 "thiserror", 821 "thiserror",
822 "ucd-trie", 822 "ucd-trie",
@@ -824,9 +824,9 @@ dependencies = [
824 824
825[[package]] 825[[package]]
826name = "pest_derive" 826name = "pest_derive"
827version = "2.4.0" 827version = "2.5.1"
828source = "registry+https://github.com/rust-lang/crates.io-index" 828source = "registry+https://github.com/rust-lang/crates.io-index"
829checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" 829checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344"
830dependencies = [ 830dependencies = [
831 "pest", 831 "pest",
832 "pest_generator", 832 "pest_generator",
@@ -834,9 +834,9 @@ dependencies = [
834 834
835[[package]] 835[[package]]
836name = "pest_generator" 836name = "pest_generator"
837version = "2.4.0" 837version = "2.5.1"
838source = "registry+https://github.com/rust-lang/crates.io-index" 838source = "registry+https://github.com/rust-lang/crates.io-index"
839checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" 839checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c"
840dependencies = [ 840dependencies = [
841 "pest", 841 "pest",
842 "pest_meta", 842 "pest_meta",
@@ -847,9 +847,9 @@ dependencies = [
847 847
848[[package]] 848[[package]]
849name = "pest_meta" 849name = "pest_meta"
850version = "2.4.0" 850version = "2.5.1"
851source = "registry+https://github.com/rust-lang/crates.io-index" 851source = "registry+https://github.com/rust-lang/crates.io-index"
852checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" 852checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20"
853dependencies = [ 853dependencies = [
854 "once_cell", 854 "once_cell",
855 "pest", 855 "pest",
@@ -912,9 +912,9 @@ dependencies = [
912 912
913[[package]] 913[[package]]
914name = "reqwest" 914name = "reqwest"
915version = "0.11.12" 915version = "0.11.13"
916source = "registry+https://github.com/rust-lang/crates.io-index" 916source = "registry+https://github.com/rust-lang/crates.io-index"
917checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" 917checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
918dependencies = [ 918dependencies = [
919 "base64", 919 "base64",
920 "bytes", 920 "bytes",
@@ -1036,18 +1036,18 @@ dependencies = [
1036 1036
1037[[package]] 1037[[package]]
1038name = "serde" 1038name = "serde"
1039version = "1.0.147" 1039version = "1.0.149"
1040source = "registry+https://github.com/rust-lang/crates.io-index" 1040source = "registry+https://github.com/rust-lang/crates.io-index"
1041checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" 1041checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055"
1042dependencies = [ 1042dependencies = [
1043 "serde_derive", 1043 "serde_derive",
1044] 1044]
1045 1045
1046[[package]] 1046[[package]]
1047name = "serde_derive" 1047name = "serde_derive"
1048version = "1.0.147" 1048version = "1.0.149"
1049source = "registry+https://github.com/rust-lang/crates.io-index" 1049source = "registry+https://github.com/rust-lang/crates.io-index"
1050checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" 1050checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4"
1051dependencies = [ 1051dependencies = [
1052 "proc-macro2", 1052 "proc-macro2",
1053 "quote", 1053 "quote",
@@ -1056,9 +1056,9 @@ dependencies = [
1056 1056
1057[[package]] 1057[[package]]
1058name = "serde_json" 1058name = "serde_json"
1059version = "1.0.87" 1059version = "1.0.89"
1060source = "registry+https://github.com/rust-lang/crates.io-index" 1060source = "registry+https://github.com/rust-lang/crates.io-index"
1061checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" 1061checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
1062dependencies = [ 1062dependencies = [
1063 "itoa", 1063 "itoa",
1064 "ryu", 1064 "ryu",
@@ -1124,9 +1124,9 @@ dependencies = [
1124 1124
1125[[package]] 1125[[package]]
1126name = "syn" 1126name = "syn"
1127version = "1.0.103" 1127version = "1.0.105"
1128source = "registry+https://github.com/rust-lang/crates.io-index" 1128source = "registry+https://github.com/rust-lang/crates.io-index"
1129checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" 1129checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
1130dependencies = [ 1130dependencies = [
1131 "proc-macro2", 1131 "proc-macro2",
1132 "quote", 1132 "quote",
@@ -1178,9 +1178,9 @@ dependencies = [
1178 1178
1179[[package]] 1179[[package]]
1180name = "time" 1180name = "time"
1181version = "0.1.44" 1181version = "0.1.45"
1182source = "registry+https://github.com/rust-lang/crates.io-index" 1182source = "registry+https://github.com/rust-lang/crates.io-index"
1183checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" 1183checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
1184dependencies = [ 1184dependencies = [
1185 "libc", 1185 "libc",
1186 "wasi 0.10.0+wasi-snapshot-preview1", 1186 "wasi 0.10.0+wasi-snapshot-preview1",
@@ -1204,9 +1204,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
1204 1204
1205[[package]] 1205[[package]]
1206name = "tokio" 1206name = "tokio"
1207version = "1.21.2" 1207version = "1.23.0"
1208source = "registry+https://github.com/rust-lang/crates.io-index" 1208source = "registry+https://github.com/rust-lang/crates.io-index"
1209checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" 1209checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46"
1210dependencies = [ 1210dependencies = [
1211 "autocfg", 1211 "autocfg",
1212 "bytes", 1212 "bytes",
@@ -1219,14 +1219,14 @@ dependencies = [
1219 "signal-hook-registry", 1219 "signal-hook-registry",
1220 "socket2", 1220 "socket2",
1221 "tokio-macros", 1221 "tokio-macros",
1222 "winapi", 1222 "windows-sys 0.42.0",
1223] 1223]
1224 1224
1225[[package]] 1225[[package]]
1226name = "tokio-macros" 1226name = "tokio-macros"
1227version = "1.8.0" 1227version = "1.8.2"
1228source = "registry+https://github.com/rust-lang/crates.io-index" 1228source = "registry+https://github.com/rust-lang/crates.io-index"
1229checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" 1229checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8"
1230dependencies = [ 1230dependencies = [
1231 "proc-macro2", 1231 "proc-macro2",
1232 "quote", 1232 "quote",
@@ -1300,9 +1300,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
1300 1300
1301[[package]] 1301[[package]]
1302name = "typenum" 1302name = "typenum"
1303version = "1.15.0" 1303version = "1.16.0"
1304source = "registry+https://github.com/rust-lang/crates.io-index" 1304source = "registry+https://github.com/rust-lang/crates.io-index"
1305checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1305checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
1306 1306
1307[[package]] 1307[[package]]
1308name = "ucd-trie" 1308name = "ucd-trie"
diff --git a/src/input.rs b/src/input.rs
index b2b4f1b..41b0c29 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -11,6 +11,7 @@ pub struct Input {
11 pub delete_old: bool, 11 pub delete_old: bool,
12 pub clean: bool, 12 pub clean: bool,
13 pub disable_download: bool, 13 pub disable_download: bool,
14 pub version: bool,
14} 15}
15 16
16impl Input { 17impl Input {
@@ -22,6 +23,7 @@ impl Input {
22 let mut delete_old = false; 23 let mut delete_old = false;
23 let mut clean = false; 24 let mut clean = false;
24 let mut disable_download = false; 25 let mut disable_download = false;
26 let mut version = false;
25 27
26 let mut toremove: Vec<usize> = vec![]; 28 let mut toremove: Vec<usize> = vec![];
27 for (i, input) in split.clone().into_iter().enumerate() { 29 for (i, input) in split.clone().into_iter().enumerate() {
@@ -32,6 +34,7 @@ impl Input {
32 "--delete-old" => delete_old = true, 34 "--delete-old" => delete_old = true,
33 "--clean" => clean = true, 35 "--clean" => clean = true,
34 "--disable-download" => disable_download = true, 36 "--disable-download" => disable_download = true,
37 "--version" => version = true,
35 _ => continue, 38 _ => continue,
36 } 39 }
37 toremove.push(i) 40 toremove.push(i)
@@ -41,6 +44,11 @@ impl Input {
41 for rem in toremove.into_iter().rev() { 44 for rem in toremove.into_iter().rev() {
42 split.remove(rem); 45 split.remove(rem);
43 } 46 }
47
48 if version {
49 println!("Modlist by FxQnLr v{}", env!("CARGO_PKG_VERSION"));
50 std::process::exit(0);
51 }
44 52
45 let command = Cmd::from(split.remove(0))?; 53 let command = Cmd::from(split.remove(0))?;
46 let subcommand = match split.is_empty() { 54 let subcommand = match split.is_empty() {
@@ -59,7 +67,7 @@ impl Input {
59 } 67 }
60 }; 68 };
61 69
62 Ok(Self { command, subcommand, args, direct_download, all_lists, delete_old, clean, disable_download }) 70 Ok(Self { command, subcommand, args, direct_download, all_lists, delete_old, clean, disable_download, version })
63 } 71 }
64} 72}
65 73
@@ -110,7 +118,7 @@ pub async fn get_input(config: Cfg) -> Result<(), Box<dyn std::error::Error>> {
110 args.reverse(); 118 args.reverse();
111 args.pop(); 119 args.pop();
112 args.reverse(); 120 args.reverse();
113 121
114 let input = Input::from(&args.join(" "))?; 122 let input = Input::from(&args.join(" "))?;
115 123
116 match input.command { 124 match input.command {
@@ -135,11 +143,10 @@ pub async fn get_input(config: Cfg) -> Result<(), Box<dyn std::error::Error>> {
135#[test] 143#[test]
136fn input_from() { 144fn input_from() {
137 let string = "list add test 1.19.2 fabric"; 145 let string = "list add test 1.19.2 fabric";
138 let input = Input{ command: Cmd::List, subcommand: Some(Subcmd::Add), args: Some(vec![String::from("test"), String::from("1.19.2"), String::from("fabric")]), direct_download: false, all_lists: false, clean: false, delete_old: false, disable_download: false }; 146 let input = Input{ command: Cmd::List, subcommand: Some(Subcmd::Add), args: Some(vec![String::from("test"), String::from("1.19.2"), String::from("fabric")]), direct_download: false, all_lists: false, clean: false, delete_old: false, disable_download: false, version: false };
139 assert_eq!(Input::from(string).unwrap(), input); 147 assert_eq!(Input::from(string).unwrap(), input);
140 148
141 let string = "update --direct-download --delete-old"; 149 let string = "update --direct-download --delete-old";
142 let input = Input{ command: Cmd::Update, subcommand: None, args: None, direct_download: true, all_lists: false, clean: false, delete_old: true, disable_download: false }; 150 let input = Input{ command: Cmd::Update, subcommand: None, args: None, direct_download: true, all_lists: false, clean: false, delete_old: true, disable_download: false, version: false };
143 assert_eq!(Input::from(string).unwrap(), input); 151 assert_eq!(Input::from(string).unwrap(), input);
144
145} 152}