diff options
-rw-r--r-- | Cargo.lock | 102 | ||||
-rw-r--r-- | src/commands/list.rs | 9 | ||||
-rw-r--r-- | src/db.rs | 2 |
3 files changed, 36 insertions, 77 deletions
@@ -137,9 +137,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" | |||
137 | 137 | ||
138 | [[package]] | 138 | [[package]] |
139 | name = "cxx" | 139 | name = "cxx" |
140 | version = "1.0.85" | 140 | version = "1.0.86" |
141 | source = "registry+https://github.com/rust-lang/crates.io-index" | 141 | source = "registry+https://github.com/rust-lang/crates.io-index" |
142 | checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" | 142 | checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" |
143 | dependencies = [ | 143 | dependencies = [ |
144 | "cc", | 144 | "cc", |
145 | "cxxbridge-flags", | 145 | "cxxbridge-flags", |
@@ -149,9 +149,9 @@ dependencies = [ | |||
149 | 149 | ||
150 | [[package]] | 150 | [[package]] |
151 | name = "cxx-build" | 151 | name = "cxx-build" |
152 | version = "1.0.85" | 152 | version = "1.0.86" |
153 | source = "registry+https://github.com/rust-lang/crates.io-index" | 153 | source = "registry+https://github.com/rust-lang/crates.io-index" |
154 | checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" | 154 | checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" |
155 | dependencies = [ | 155 | dependencies = [ |
156 | "cc", | 156 | "cc", |
157 | "codespan-reporting", | 157 | "codespan-reporting", |
@@ -164,15 +164,15 @@ dependencies = [ | |||
164 | 164 | ||
165 | [[package]] | 165 | [[package]] |
166 | name = "cxxbridge-flags" | 166 | name = "cxxbridge-flags" |
167 | version = "1.0.85" | 167 | version = "1.0.86" |
168 | source = "registry+https://github.com/rust-lang/crates.io-index" | 168 | source = "registry+https://github.com/rust-lang/crates.io-index" |
169 | checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" | 169 | checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" |
170 | 170 | ||
171 | [[package]] | 171 | [[package]] |
172 | name = "cxxbridge-macro" | 172 | name = "cxxbridge-macro" |
173 | version = "1.0.85" | 173 | version = "1.0.86" |
174 | source = "registry+https://github.com/rust-lang/crates.io-index" | 174 | source = "registry+https://github.com/rust-lang/crates.io-index" |
175 | checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" | 175 | checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" |
176 | dependencies = [ | 176 | dependencies = [ |
177 | "proc-macro2", | 177 | "proc-macro2", |
178 | "quote", | 178 | "quote", |
@@ -510,9 +510,9 @@ dependencies = [ | |||
510 | 510 | ||
511 | [[package]] | 511 | [[package]] |
512 | name = "ipnet" | 512 | name = "ipnet" |
513 | version = "2.7.0" | 513 | version = "2.7.1" |
514 | source = "registry+https://github.com/rust-lang/crates.io-index" | 514 | source = "registry+https://github.com/rust-lang/crates.io-index" |
515 | checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" | 515 | checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" |
516 | 516 | ||
517 | [[package]] | 517 | [[package]] |
518 | name = "itoa" | 518 | name = "itoa" |
@@ -610,7 +610,7 @@ dependencies = [ | |||
610 | "libc", | 610 | "libc", |
611 | "log", | 611 | "log", |
612 | "wasi 0.11.0+wasi-snapshot-preview1", | 612 | "wasi 0.11.0+wasi-snapshot-preview1", |
613 | "windows-sys 0.42.0", | 613 | "windows-sys", |
614 | ] | 614 | ] |
615 | 615 | ||
616 | [[package]] | 616 | [[package]] |
@@ -678,18 +678,18 @@ dependencies = [ | |||
678 | 678 | ||
679 | [[package]] | 679 | [[package]] |
680 | name = "object" | 680 | name = "object" |
681 | version = "0.30.0" | 681 | version = "0.30.2" |
682 | source = "registry+https://github.com/rust-lang/crates.io-index" | 682 | source = "registry+https://github.com/rust-lang/crates.io-index" |
683 | checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" | 683 | checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" |
684 | dependencies = [ | 684 | dependencies = [ |
685 | "memchr", | 685 | "memchr", |
686 | ] | 686 | ] |
687 | 687 | ||
688 | [[package]] | 688 | [[package]] |
689 | name = "once_cell" | 689 | name = "once_cell" |
690 | version = "1.16.0" | 690 | version = "1.17.0" |
691 | source = "registry+https://github.com/rust-lang/crates.io-index" | 691 | source = "registry+https://github.com/rust-lang/crates.io-index" |
692 | checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" | 692 | checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" |
693 | 693 | ||
694 | [[package]] | 694 | [[package]] |
695 | name = "openssl" | 695 | name = "openssl" |
@@ -756,7 +756,7 @@ dependencies = [ | |||
756 | "libc", | 756 | "libc", |
757 | "redox_syscall", | 757 | "redox_syscall", |
758 | "smallvec", | 758 | "smallvec", |
759 | "windows-sys 0.42.0", | 759 | "windows-sys", |
760 | ] | 760 | ] |
761 | 761 | ||
762 | [[package]] | 762 | [[package]] |
@@ -896,12 +896,11 @@ checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" | |||
896 | 896 | ||
897 | [[package]] | 897 | [[package]] |
898 | name = "schannel" | 898 | name = "schannel" |
899 | version = "0.1.20" | 899 | version = "0.1.21" |
900 | source = "registry+https://github.com/rust-lang/crates.io-index" | 900 | source = "registry+https://github.com/rust-lang/crates.io-index" |
901 | checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" | 901 | checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" |
902 | dependencies = [ | 902 | dependencies = [ |
903 | "lazy_static", | 903 | "windows-sys", |
904 | "windows-sys 0.36.1", | ||
905 | ] | 904 | ] |
906 | 905 | ||
907 | [[package]] | 906 | [[package]] |
@@ -1098,9 +1097,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" | |||
1098 | 1097 | ||
1099 | [[package]] | 1098 | [[package]] |
1100 | name = "tokio" | 1099 | name = "tokio" |
1101 | version = "1.23.0" | 1100 | version = "1.24.1" |
1102 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1103 | checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" | 1102 | checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" |
1104 | dependencies = [ | 1103 | dependencies = [ |
1105 | "autocfg", | 1104 | "autocfg", |
1106 | "bytes", | 1105 | "bytes", |
@@ -1113,7 +1112,7 @@ dependencies = [ | |||
1113 | "signal-hook-registry", | 1112 | "signal-hook-registry", |
1114 | "socket2", | 1113 | "socket2", |
1115 | "tokio-macros", | 1114 | "tokio-macros", |
1116 | "windows-sys 0.42.0", | 1115 | "windows-sys", |
1117 | ] | 1116 | ] |
1118 | 1117 | ||
1119 | [[package]] | 1118 | [[package]] |
@@ -1188,9 +1187,9 @@ dependencies = [ | |||
1188 | 1187 | ||
1189 | [[package]] | 1188 | [[package]] |
1190 | name = "try-lock" | 1189 | name = "try-lock" |
1191 | version = "0.2.3" | 1190 | version = "0.2.4" |
1192 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1193 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" | 1192 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" |
1194 | 1193 | ||
1195 | [[package]] | 1194 | [[package]] |
1196 | name = "unicode-bidi" | 1195 | name = "unicode-bidi" |
@@ -1373,30 +1372,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" | |||
1373 | 1372 | ||
1374 | [[package]] | 1373 | [[package]] |
1375 | name = "windows-sys" | 1374 | name = "windows-sys" |
1376 | version = "0.36.1" | ||
1377 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1378 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" | ||
1379 | dependencies = [ | ||
1380 | "windows_aarch64_msvc 0.36.1", | ||
1381 | "windows_i686_gnu 0.36.1", | ||
1382 | "windows_i686_msvc 0.36.1", | ||
1383 | "windows_x86_64_gnu 0.36.1", | ||
1384 | "windows_x86_64_msvc 0.36.1", | ||
1385 | ] | ||
1386 | |||
1387 | [[package]] | ||
1388 | name = "windows-sys" | ||
1389 | version = "0.42.0" | 1375 | version = "0.42.0" |
1390 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1391 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" | 1377 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" |
1392 | dependencies = [ | 1378 | dependencies = [ |
1393 | "windows_aarch64_gnullvm", | 1379 | "windows_aarch64_gnullvm", |
1394 | "windows_aarch64_msvc 0.42.0", | 1380 | "windows_aarch64_msvc", |
1395 | "windows_i686_gnu 0.42.0", | 1381 | "windows_i686_gnu", |
1396 | "windows_i686_msvc 0.42.0", | 1382 | "windows_i686_msvc", |
1397 | "windows_x86_64_gnu 0.42.0", | 1383 | "windows_x86_64_gnu", |
1398 | "windows_x86_64_gnullvm", | 1384 | "windows_x86_64_gnullvm", |
1399 | "windows_x86_64_msvc 0.42.0", | 1385 | "windows_x86_64_msvc", |
1400 | ] | 1386 | ] |
1401 | 1387 | ||
1402 | [[package]] | 1388 | [[package]] |
@@ -1407,48 +1393,24 @@ checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" | |||
1407 | 1393 | ||
1408 | [[package]] | 1394 | [[package]] |
1409 | name = "windows_aarch64_msvc" | 1395 | name = "windows_aarch64_msvc" |
1410 | version = "0.36.1" | ||
1411 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1412 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" | ||
1413 | |||
1414 | [[package]] | ||
1415 | name = "windows_aarch64_msvc" | ||
1416 | version = "0.42.0" | 1396 | version = "0.42.0" |
1417 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1418 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" | 1398 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" |
1419 | 1399 | ||
1420 | [[package]] | 1400 | [[package]] |
1421 | name = "windows_i686_gnu" | 1401 | name = "windows_i686_gnu" |
1422 | version = "0.36.1" | ||
1423 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1424 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" | ||
1425 | |||
1426 | [[package]] | ||
1427 | name = "windows_i686_gnu" | ||
1428 | version = "0.42.0" | 1402 | version = "0.42.0" |
1429 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1403 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1430 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" | 1404 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" |
1431 | 1405 | ||
1432 | [[package]] | 1406 | [[package]] |
1433 | name = "windows_i686_msvc" | 1407 | name = "windows_i686_msvc" |
1434 | version = "0.36.1" | ||
1435 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1436 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" | ||
1437 | |||
1438 | [[package]] | ||
1439 | name = "windows_i686_msvc" | ||
1440 | version = "0.42.0" | 1408 | version = "0.42.0" |
1441 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1409 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1442 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" | 1410 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" |
1443 | 1411 | ||
1444 | [[package]] | 1412 | [[package]] |
1445 | name = "windows_x86_64_gnu" | 1413 | name = "windows_x86_64_gnu" |
1446 | version = "0.36.1" | ||
1447 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1448 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" | ||
1449 | |||
1450 | [[package]] | ||
1451 | name = "windows_x86_64_gnu" | ||
1452 | version = "0.42.0" | 1414 | version = "0.42.0" |
1453 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1454 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" | 1416 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" |
@@ -1461,12 +1423,6 @@ checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" | |||
1461 | 1423 | ||
1462 | [[package]] | 1424 | [[package]] |
1463 | name = "windows_x86_64_msvc" | 1425 | name = "windows_x86_64_msvc" |
1464 | version = "0.36.1" | ||
1465 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1466 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" | ||
1467 | |||
1468 | [[package]] | ||
1469 | name = "windows_x86_64_msvc" | ||
1470 | version = "0.42.0" | 1426 | version = "0.42.0" |
1471 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1427 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1472 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" | 1428 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" |
diff --git a/src/commands/list.rs b/src/commands/list.rs index a02f8b1..3998cce 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs | |||
@@ -23,7 +23,10 @@ pub async fn list(config: Cfg, input: Input) -> Result<(), Box<dyn std::error::E | |||
23 | change(config, input.args) | 23 | change(config, input.args) |
24 | }, | 24 | }, |
25 | Subcmd::Remove => { | 25 | Subcmd::Remove => { |
26 | remove(config, input.args.ok_or("")?) | 26 | match remove(config, input.args.ok_or("")?) { |
27 | Ok(..) => Ok(()), | ||
28 | Err(e) => Err(Box::new(e)) | ||
29 | } | ||
27 | }, | 30 | }, |
28 | Subcmd::Version => { | 31 | Subcmd::Version => { |
29 | match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await { | 32 | match version(config, Some(input.args.ok_or("NO_VERSION")?), Some(MCVersionType::Release)).await { |
@@ -72,10 +75,10 @@ fn change(config: Cfg, args: Option<Vec<String>>) -> Result<(), Box<dyn std::err | |||
72 | } | 75 | } |
73 | } | 76 | } |
74 | 77 | ||
75 | fn remove(config: Cfg, args: Vec<String>) -> Result<(), Box<dyn std::error::Error>> { | 78 | fn remove(config: Cfg, args: Vec<String>) -> MLE<()> { |
76 | match args.len() { | 79 | match args.len() { |
77 | 1 => lists_remove(config, String::from(&args[0])), | 80 | 1 => lists_remove(config, String::from(&args[0])), |
78 | 2.. => Err(Box::new(Error::new(ErrorKind::InvalidInput, "TOO_MANY_ARGUMENTS"))), | 81 | 2.. => Err(MLError::new(ErrorType::ArgumentCountError, "TOO_MANY_ARGUMENTS")), |
79 | _ => panic!("list arguments should never be zero or lower"), | 82 | _ => panic!("list arguments should never be zero or lower"), |
80 | } | 83 | } |
81 | } | 84 | } |
@@ -361,7 +361,7 @@ pub fn lists_insert(config: Cfg, id: String, mc_version: String, mod_loader: Mod | |||
361 | Ok(()) | 361 | Ok(()) |
362 | } | 362 | } |
363 | 363 | ||
364 | pub fn lists_remove(config: Cfg, id: String) -> Result<(), Box<dyn std::error::Error>> { | 364 | pub fn lists_remove(config: Cfg, id: String) -> MLE<()> { |
365 | let data = devdir(format!("{}/data.db", config.data).as_str()); | 365 | let data = devdir(format!("{}/data.db", config.data).as_str()); |
366 | let connection = Connection::open(data)?; | 366 | let connection = Connection::open(data)?; |
367 | 367 | ||