diff --git a/Cargo.lock b/Cargo.lock index 394c8e28c12a7f2b1d206c07fb420f9804e1865a..96da25c51854056a725349f5e8fba0ffc440b4c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,15 +9,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - [[package]] name = "anyhow" version = "1.0.40" @@ -401,13 +392,9 @@ version = "2.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ - "ansi_term", - "atty", "bitflags 1.2.1", - "strsim 0.8.0", "textwrap", "unicode-width", - "vec_map", ] [[package]] @@ -592,7 +579,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.9.3", + "strsim", "syn", ] @@ -819,7 +806,6 @@ dependencies = [ "duniter-global", "duniter-mempools", "duniter-module", - "duniter-module-cli", "rusty-hook", ] @@ -912,15 +898,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "duniter-module-cli" -version = "0.1.0" -dependencies = [ - "anyhow", - "serde", - "structopt", -] - [[package]] name = "dup-crypto" version = "0.53.1" @@ -1913,30 +1890,6 @@ dependencies = [ "treeline", ] -[[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", - "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.19" @@ -2294,42 +2247,12 @@ dependencies = [ "lock_api", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" -[[package]] -name = "structopt" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" -dependencies = [ - "clap", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "subtle" version = "2.4.0" @@ -2668,12 +2591,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.3" diff --git a/Cargo.toml b/Cargo.toml index 5b35eff470eabe537d24fb486c8299f0da8d3c55..09d2344f939a6677b0929ae6e60e84971ab0c2a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,6 @@ duniter-dbs = { path = "dbs" } duniter-dbs-write-ops = { path = "dbs-write-ops", optional = true } duniter-mempools = { path = "mempools" } duniter-module = { path = "module" } -duniter-module-cli = { path = "module-cli" } duniter-global = { path = "global" } [features] @@ -37,7 +36,6 @@ members = [ "dbs-write-ops", "mempools", "module", - "module-cli", "global", "tools/kv_typed" ] diff --git a/module-cli/Cargo.toml b/module-cli/Cargo.toml deleted file mode 100644 index 6ebe0194b1f35a8e449dda7ea7d2567f33901e3e..0000000000000000000000000000000000000000 --- a/module-cli/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "duniter-module-cli" -version = "0.1.0" -authors = ["librelois <elois@duniter.org>"] -license = "AGPL-3.0" -edition = "2018" - -[dependencies] -anyhow = "1.0" -serde = "1.0" -structopt = "0.3" - -[dev-dependencies] diff --git a/module-cli/src/lib.rs b/module-cli/src/lib.rs deleted file mode 100644 index 5c387106f66d0632ddc03bc1165b1ea96cedaf11..0000000000000000000000000000000000000000 --- a/module-cli/src/lib.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2020 Éloïs SANCHEZ. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see <https://www.gnu.org/licenses/>. - -pub use anyhow; -pub use structopt; - -use std::path::PathBuf; -use structopt::StructOpt; - -pub trait DuniterModuleCli: 'static + Sized { - const MODULE_NAME: &'static str; - - type Conf: Default + serde::de::DeserializeOwned; - type ConfigureOpt: StructOpt; - type Opt: StructOpt; - - /// Execute configure command - fn configure(actual_conf: Self::Conf, opt: Self::ConfigureOpt) -> Self::Conf; - - /// Execute module command - fn command(conf: Self::Conf, opt: Self::Opt, data_path: PathBuf) -> anyhow::Result<()>; -} diff --git a/src/lib.rs b/src/lib.rs index d0842b05af6c960c810f2ddf1dbc597da727eb11..b0334c3e08d230ce06734e7ae42b561cd8dfd32d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,4 +20,3 @@ pub use duniter_dbs_write_ops as dbs_write_ops; pub use duniter_global as global; pub use duniter_mempools as mempools; pub use duniter_module as module; -pub use duniter_module_cli as module_cli;