From 0d22f55083f8d9484888ead6ee1fac08044afc10 Mon Sep 17 00:00:00 2001 From: Tarek Date: Wed, 13 Mar 2024 00:35:02 +0200 Subject: [PATCH] refactor: move ark-cli folders inside a crate Signed-off-by: Tarek --- Cargo.lock | 558 +++++++++++++++++- Cargo.toml | 2 + README.md | 118 +--- ark-cli/Cargo.toml | 22 + ark-cli/README.md | 111 ++++ USAGE.md => ark-cli/USAGE.md | 0 {ark-shelf => ark-cli/ark-shelf}/16-720383087 | 0 .../ark-shelf}/18-1909444406 | 0 {src => ark-cli/src}/commands/file.rs | 0 {src => ark-cli/src}/commands/link.rs | 0 {src => ark-cli/src}/commands/mod.rs | 0 {src => ark-cli/src}/error.rs | 0 {src => ark-cli/src}/main.rs | 0 {src => ark-cli/src}/models/cli.rs | 0 {src => ark-cli/src}/models/entry.rs | 0 {src => ark-cli/src}/models/format.rs | 0 {src => ark-cli/src}/models/mod.rs | 0 {src => ark-cli/src}/models/sort.rs | 0 {src => ark-cli/src}/models/storage.rs | 0 {src => ark-cli/src}/util.rs | 0 20 files changed, 687 insertions(+), 124 deletions(-) create mode 100644 ark-cli/Cargo.toml create mode 100644 ark-cli/README.md rename USAGE.md => ark-cli/USAGE.md (100%) rename {ark-shelf => ark-cli/ark-shelf}/16-720383087 (100%) rename {ark-shelf => ark-cli/ark-shelf}/18-1909444406 (100%) rename {src => ark-cli/src}/commands/file.rs (100%) rename {src => ark-cli/src}/commands/link.rs (100%) rename {src => ark-cli/src}/commands/mod.rs (100%) rename {src => ark-cli/src}/error.rs (100%) rename {src => ark-cli/src}/main.rs (100%) rename {src => ark-cli/src}/models/cli.rs (100%) rename {src => ark-cli/src}/models/entry.rs (100%) rename {src => ark-cli/src}/models/format.rs (100%) rename {src => ark-cli/src}/models/mod.rs (100%) rename {src => ark-cli/src}/models/sort.rs (100%) rename {src => ark-cli/src}/models/storage.rs (100%) rename {src => ark-cli/src}/util.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index a0a789a3..ffd1c705 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -39,6 +50,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anes" version = "0.1.6" @@ -57,12 +83,78 @@ version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +[[package]] +name = "ark-cli" +version = "0.1.0" +dependencies = [ + "anyhow", + "arklib", + "chrono", + "clap 3.2.25", + "env_logger", + "fs_extra", + "home", + "serde", + "serde_json", + "thiserror", + "tokio", + "url", + "walkdir", +] + +[[package]] +name = "arklib" +version = "0.1.0" +source = "git+https://github.com/ARK-Builders/arklib?rev=2c7ceda#2c7ceda1a6c7285e406b64762d6a977c5ab8000a" +dependencies = [ + "anyhow", + "canonical-path", + "crc32fast", + "env_logger", + "fastrand", + "flate2", + "fs_extra", + "image", + "itertools", + "lazy_static", + "libloading", + "log", + "once_cell", + "pathdiff", + "pdfium-render", + "reqwest", + "ring", + "scraper", + "serde", + "serde_json", + "tar", + "target-lexicon", + "thiserror", + "tokio", + "ureq", + "url", + "uuid", + "walkdir", + "zip", +] + [[package]] name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -90,6 +182,12 @@ version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bindgen" version = "0.69.1" @@ -131,6 +229,15 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" version = "3.14.0" @@ -155,6 +262,27 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "canonical-path" version = "2.0.2" @@ -173,6 +301,7 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -191,6 +320,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", +] + [[package]] name = "ciborium" version = "0.2.2" @@ -218,6 +361,16 @@ dependencies = [ "half", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.6.1" @@ -229,6 +382,23 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + [[package]] name = "clap" version = "4.5.2" @@ -245,7 +415,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstyle", - "clap_lex", + "clap_lex 0.7.0", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -280,6 +472,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "convert_case" version = "0.4.0" @@ -311,6 +509,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -329,7 +536,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap", + "clap 4.5.2", "criterion-plot", "is-terminal", "itertools", @@ -394,6 +601,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "cssparser" version = "0.27.2" @@ -499,6 +716,15 @@ dependencies = [ "uuid", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -512,6 +738,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "dtoa" version = "1.0.9" @@ -548,6 +785,19 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -854,6 +1104,16 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getopts" version = "0.2.21" @@ -919,7 +1179,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -935,18 +1195,48 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "home" version = "0.5.9" @@ -1004,6 +1294,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" version = "0.14.28" @@ -1041,6 +1337,29 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.5.0" @@ -1070,6 +1389,16 @@ dependencies = [ "tiff", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.1.0" @@ -1077,7 +1406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -1087,7 +1416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "321f0f839cd44a4686e9504b0a62b4d69a50b62072144c71c68f5873c167b8d9" dependencies = [ "ahash", - "indexmap", + "indexmap 2.1.0", "is-terminal", "itoa 1.0.10", "log", @@ -1098,6 +1427,15 @@ dependencies = [ "str_stack", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -1110,7 +1448,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.3", "libc", "windows-sys 0.52.0", ] @@ -1145,6 +1483,15 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -1359,6 +1706,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-format" version = "0.4.4" @@ -1405,7 +1758,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.3", "libc", ] @@ -1474,6 +1827,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + [[package]] name = "parking_lot" version = "0.12.1" @@ -1497,12 +1856,35 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "pathdiff" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + [[package]] name = "pdfium-render" version = "0.7.26" @@ -1696,6 +2078,12 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "pprof" version = "0.13.0" @@ -1740,6 +2128,30 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.20+deprecated" @@ -2277,6 +2689,28 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.2.0" @@ -2376,6 +2810,18 @@ dependencies = [ "quote", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "symbolic-common" version = "12.8.0" @@ -2493,6 +2939,21 @@ dependencies = [ "utf-8", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + [[package]] name = "thin-slice" version = "0.1.1" @@ -2530,6 +2991,25 @@ dependencies = [ "weezl", ] +[[package]] +name = "time" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + [[package]] name = "tinytemplate" version = "1.2.1" @@ -2640,6 +3120,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-bidi" version = "0.3.14" @@ -2908,6 +3394,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -3081,6 +3576,55 @@ dependencies = [ "syn 2.0.52", ] +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.9+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +dependencies = [ + "cc", + "pkg-config", +] + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.toml b/Cargo.toml index 1a75dffd..78f4d2fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = [ + "ark-cli", "data-error", "data-json", "data-link", @@ -12,6 +13,7 @@ members = [ ] default-members = [ + "ark-cli", "data-error", "data-json", "data-link", diff --git a/README.md b/README.md index f8ff344f..8291ffd5 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The purpose of the library is to manage _resource index_ of folders with various | Package | Description | | --------------- | ---------------------------------------- | +| `ark-cli` | The CLI tool to interact with ark crates | | `data-resource` | Resource hashing and ID construction | | `fs-index` | Resource Index construction and updating | | `fs-storage` | Filesystem storage for resources | @@ -67,120 +68,3 @@ Our benchmark suite includes tests on local files and directories. These benchma You have the flexibility to benchmark specific files or folders by modifying the variables within the benchmark files. By default, the benchmarks operate on the [`test-assets/`](test-assets/) directory and its contents. You can change the directory/files by setting the `DIR_PATH` and `FILE_PATHS` variables to the desired values. For pre-benchmark assessment of required time to index a huge local folder, you can modify `test_build_resource_index` test case in `src/index.rs`. - -# Ark-CLI - -### Installation - -To compile you will need openssl libraries and headers: - -```shell -# macOS (Homebrew) -$ brew install openssl@3 - -# macOS (MacPorts) -$ sudo port install openssl - -# macOS (pkgsrc) -$ sudo pkgin install openssl - -# Arch Linux -$ sudo pacman -S pkg-config openssl - -# Debian and Ubuntu -$ sudo apt-get install pkg-config libssl-dev - -# Fedora -$ sudo dnf install pkg-config perl-FindBin openssl-devel - -# Alpine Linux -$ apk add pkgconfig openssl-dev -``` - -### Usage - -```shell -ark-cli - -OPTIONS: - -h, --help Print help information - -SUBCOMMANDS: - backup - collisions - help Print this message or the help of the given subcommand(s) - link - monitor - render - -``` - -#### Backup - -```shell -USAGE: - ark-cli backup [ROOTS_CFG] - -ARGS: - - -OPTIONS: - -h, --help Print help information -``` - -#### Collisions - -```shell -USAGE: - ark-cli collisions [ROOT_DIR] - -ARGS: - - -OPTIONS: - -h, --help Print help information -``` - -#### Link - -```shell -USAGE: - ark-cli link - -OPTIONS: - -h, --help Print help information - -SUBCOMMANDS: - create - help Print this message or the help of the given subcommand(s) - load -``` - -#### Monitor - -```shell -USAGE: - ark-cli monitor [ARGS] - -ARGS: - - - -OPTIONS: - -h, --help Print help information -``` - -#### Render - -```shell -USAGE: - ark-cli render [ARGS] - -ARGS: - - - -OPTIONS: - -h, --help Print help information - -``` diff --git a/ark-cli/Cargo.toml b/ark-cli/Cargo.toml new file mode 100644 index 00000000..1c257ce7 --- /dev/null +++ b/ark-cli/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "ark-cli" +version = "0.1.0" +edition = "2021" + +[[bin]] +name = "ark-cli" + +[dependencies] +tokio = { version = "1.35.1", features = ["full"] } +arklib = { git = "https://github.com/ARK-Builders/arklib", rev = "2c7ceda" } +clap = { version = "3.0.10", features = ["derive"] } +env_logger = "0.9.0" +fs_extra = "1.2.0" +walkdir = "2.3.2" +home = "0.5.3" +url = { version = "2.2.2", features = ["serde"] } +serde_json = "1.0.82" +serde = { version = "1.0.138", features = ["derive"] } +chrono = "0.4.34" +anyhow = "1.0.80" +thiserror = "1.0.57" diff --git a/ark-cli/README.md b/ark-cli/README.md new file mode 100644 index 00000000..da191e1e --- /dev/null +++ b/ark-cli/README.md @@ -0,0 +1,111 @@ +# Ark-CLI + +### Installation + +To compile you will need openssl libraries and headers: + +```shell +# macOS (Homebrew) +$ brew install openssl@3 + +# macOS (MacPorts) +$ sudo port install openssl + +# macOS (pkgsrc) +$ sudo pkgin install openssl + +# Arch Linux +$ sudo pacman -S pkg-config openssl + +# Debian and Ubuntu +$ sudo apt-get install pkg-config libssl-dev + +# Fedora +$ sudo dnf install pkg-config perl-FindBin openssl-devel + +# Alpine Linux +$ apk add pkgconfig openssl-dev +``` + +### Usage + +```shell +ark-cli + +OPTIONS: + -h, --help Print help information + +SUBCOMMANDS: + backup + collisions + help Print this message or the help of the given subcommand(s) + link + monitor + render + +``` + +#### Backup +```shell +USAGE: + ark-cli backup [ROOTS_CFG] + +ARGS: + + +OPTIONS: + -h, --help Print help information +``` + +#### Collisions +```shell +USAGE: + ark-cli collisions [ROOT_DIR] + +ARGS: + + +OPTIONS: + -h, --help Print help information +``` + +#### Link +```shell +USAGE: + ark-cli link + +OPTIONS: + -h, --help Print help information + +SUBCOMMANDS: + create + help Print this message or the help of the given subcommand(s) + load +``` + +#### Monitor +```shell +USAGE: + ark-cli monitor [ARGS] + +ARGS: + + + +OPTIONS: + -h, --help Print help information +``` + +#### Render +```shell +USAGE: + ark-cli render [ARGS] + +ARGS: + + + +OPTIONS: + -h, --help Print help information + +``` \ No newline at end of file diff --git a/USAGE.md b/ark-cli/USAGE.md similarity index 100% rename from USAGE.md rename to ark-cli/USAGE.md diff --git a/ark-shelf/16-720383087 b/ark-cli/ark-shelf/16-720383087 similarity index 100% rename from ark-shelf/16-720383087 rename to ark-cli/ark-shelf/16-720383087 diff --git a/ark-shelf/18-1909444406 b/ark-cli/ark-shelf/18-1909444406 similarity index 100% rename from ark-shelf/18-1909444406 rename to ark-cli/ark-shelf/18-1909444406 diff --git a/src/commands/file.rs b/ark-cli/src/commands/file.rs similarity index 100% rename from src/commands/file.rs rename to ark-cli/src/commands/file.rs diff --git a/src/commands/link.rs b/ark-cli/src/commands/link.rs similarity index 100% rename from src/commands/link.rs rename to ark-cli/src/commands/link.rs diff --git a/src/commands/mod.rs b/ark-cli/src/commands/mod.rs similarity index 100% rename from src/commands/mod.rs rename to ark-cli/src/commands/mod.rs diff --git a/src/error.rs b/ark-cli/src/error.rs similarity index 100% rename from src/error.rs rename to ark-cli/src/error.rs diff --git a/src/main.rs b/ark-cli/src/main.rs similarity index 100% rename from src/main.rs rename to ark-cli/src/main.rs diff --git a/src/models/cli.rs b/ark-cli/src/models/cli.rs similarity index 100% rename from src/models/cli.rs rename to ark-cli/src/models/cli.rs diff --git a/src/models/entry.rs b/ark-cli/src/models/entry.rs similarity index 100% rename from src/models/entry.rs rename to ark-cli/src/models/entry.rs diff --git a/src/models/format.rs b/ark-cli/src/models/format.rs similarity index 100% rename from src/models/format.rs rename to ark-cli/src/models/format.rs diff --git a/src/models/mod.rs b/ark-cli/src/models/mod.rs similarity index 100% rename from src/models/mod.rs rename to ark-cli/src/models/mod.rs diff --git a/src/models/sort.rs b/ark-cli/src/models/sort.rs similarity index 100% rename from src/models/sort.rs rename to ark-cli/src/models/sort.rs diff --git a/src/models/storage.rs b/ark-cli/src/models/storage.rs similarity index 100% rename from src/models/storage.rs rename to ark-cli/src/models/storage.rs diff --git a/src/util.rs b/ark-cli/src/util.rs similarity index 100% rename from src/util.rs rename to ark-cli/src/util.rs