From 84df58cf81e89571d5044d7669d85bceed7e7776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Sun, 17 Jan 2021 10:03:19 +0100 Subject: [PATCH] add json serializer lib (prepare #18) --- Cargo.lock | 128 +++-------------------------------------------------- Cargo.toml | 3 +- README.md | 12 ++--- 3 files changed, 12 insertions(+), 131 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac5b1d5..2a1baa5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -170,27 +170,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "encoding_rs" version = "0.8.26" @@ -221,16 +200,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "1.1.0" @@ -248,17 +217,6 @@ dependencies = [ "wasi 0.9.0+wasi-snapshot-preview1", ] -[[package]] -name = "getrandom" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4060f4657be78b8e766215b02b18a2e862d83745545de804638e2b545e81aee6" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", -] - [[package]] name = "hermit-abi" version = "0.1.17" @@ -277,9 +235,8 @@ dependencies = [ "lettre", "mailparse", "native-tls", - "rfc2047-decoder", - "rustyline", "serde", + "serde_json", "terminal_size", "toml", ] @@ -512,18 +469,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nix" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", -] - [[package]] name = "nom" version = "5.1.2" @@ -624,7 +569,7 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.1.57", + "redox_syscall", "smallvec", "winapi", ] @@ -694,7 +639,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom", "libc", "rand_chacha", "rand_core", @@ -717,7 +662,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom", ] [[package]] @@ -735,25 +680,6 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" -[[package]] -name = "redox_syscall" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom 0.2.1", - "redox_syscall 0.2.4", -] - [[package]] name = "regex" version = "1.4.2" @@ -781,38 +707,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rfc2047-decoder" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ecf2ba387f446155e26796aabb727e9ae1427dd13ac9cc21773a3fbda19d77" -dependencies = [ - "base64 0.13.0", - "charset", - "quoted_printable", -] - -[[package]] -name = "rustyline" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8227301bfc717136f0ecbd3d064ba8199e44497a0bdd46bb01ede4387cfd2cec" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "dirs-next", - "fs2", - "libc", - "log", - "memchr", - "nix", - "scopeguard", - "unicode-segmentation", - "unicode-width", - "utf8parse", - "winapi", -] - [[package]] name = "ryu" version = "1.0.5" @@ -942,7 +836,7 @@ dependencies = [ "cfg-if 0.1.10", "libc", "rand", - "redox_syscall 0.1.57", + "redox_syscall", "remove_dir_all", "winapi", ] @@ -1037,12 +931,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" - [[package]] name = "unicode-width" version = "0.1.8" @@ -1055,12 +943,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" -[[package]] -name = "utf8parse" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" - [[package]] name = "uuid" version = "0.8.1" diff --git a/Cargo.toml b/Cargo.toml index 9e3b2dd..3529c02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,7 @@ imap = "2.4.0" lettre = "0.10.0-alpha.4" mailparse = "0.13.1" native-tls = "0.2" -rfc2047-decoder = "0.1.2" -rustyline = "7.1.0" serde = { version = "1.0.118", features = ["derive"] } +serde_json = "1.0.61" terminal_size = "0.1.15" toml = "0.5.8" diff --git a/README.md b/README.md index e2a89aa..86ec810 100644 --- a/README.md +++ b/README.md @@ -3,26 +3,26 @@ Minimalist CLI email client, written in Rust. ```bash -himalaya --help -``` - -```help Himalaya 0.1.0 soywod 📫 Minimalist CLI email client USAGE: - himalaya [SUBCOMMAND] + himalaya [OPTIONS] [SUBCOMMAND] FLAGS: -h, --help Prints help information -V, --version Prints version information +OPTIONS: + -a, --account Name of the config file to use + SUBCOMMANDS: attachments Downloads all attachments from an email forward Forwards an email help Prints this message or the help of the given subcommand(s) - list Lists all available mailboxes + list Lists emails sorted by arrival date + mailboxes Lists all available mailboxes read Reads text bodies of an email reply Answers to an email search Lists emails matching the given IMAP query