From 7a56dabd39c28d05f558e72106e8f2b5a2b1a00f Mon Sep 17 00:00:00 2001 From: timvisee Date: Thu, 8 Mar 2018 23:02:06 +0100 Subject: [PATCH] Extract CLI logic to a child project --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 18 ++++-------------- cli/Cargo.toml | 13 +++++++++++++ {src => cli/src}/action/mod.rs | 0 {src => cli/src}/action/upload.rs | 0 {src => cli/src}/app.rs | 0 {src => cli/src}/cmd/cmd_upload.rs | 0 {src => cli/src}/cmd/handler.rs | 0 {src => cli/src}/cmd/mod.rs | 0 {src => cli/src}/main.rs | 0 {src => cli/src}/util.rs | 0 11 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 cli/Cargo.toml rename {src => cli/src}/action/mod.rs (100%) rename {src => cli/src}/action/upload.rs (100%) rename {src => cli/src}/app.rs (100%) rename {src => cli/src}/cmd/cmd_upload.rs (100%) rename {src => cli/src}/cmd/handler.rs (100%) rename {src => cli/src}/cmd/mod.rs (100%) rename {src => cli/src}/main.rs (100%) rename {src => cli/src}/util.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 682489b..825d0ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -176,15 +176,6 @@ name = "fake-simd" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "ffsend" -version = "0.1.0" -dependencies = [ - "clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ffsend-api 0.1.0", - "open 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ffsend-api" version = "0.1.0" @@ -203,6 +194,15 @@ dependencies = [ "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ffsend-cli" +version = "0.1.0" +dependencies = [ + "clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ffsend-api 0.1.0", + "open 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "foreign-types" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index 57321e6..bd2d0c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,5 @@ -[package] -name = "ffsend" -version = "0.1.0" -authors = ["timvisee "] - -[[bin]] -name = "ffsend" - [workspace] -members = ["api"] - -[dependencies] -clap = "2.31" -ffsend-api = { version = "*", path = "api" } -open = "1" +members = [ + "api", + "cli", +] diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000..6dc194a --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "ffsend-cli" +version = "0.1.0" +authors = ["timvisee "] + +[[bin]] +path = "src/main.rs" +name = "ffsend" + +[dependencies] +clap = "2.31" +ffsend-api = { version = "*", path = "../api" } +open = "1" diff --git a/src/action/mod.rs b/cli/src/action/mod.rs similarity index 100% rename from src/action/mod.rs rename to cli/src/action/mod.rs diff --git a/src/action/upload.rs b/cli/src/action/upload.rs similarity index 100% rename from src/action/upload.rs rename to cli/src/action/upload.rs diff --git a/src/app.rs b/cli/src/app.rs similarity index 100% rename from src/app.rs rename to cli/src/app.rs diff --git a/src/cmd/cmd_upload.rs b/cli/src/cmd/cmd_upload.rs similarity index 100% rename from src/cmd/cmd_upload.rs rename to cli/src/cmd/cmd_upload.rs diff --git a/src/cmd/handler.rs b/cli/src/cmd/handler.rs similarity index 100% rename from src/cmd/handler.rs rename to cli/src/cmd/handler.rs diff --git a/src/cmd/mod.rs b/cli/src/cmd/mod.rs similarity index 100% rename from src/cmd/mod.rs rename to cli/src/cmd/mod.rs diff --git a/src/main.rs b/cli/src/main.rs similarity index 100% rename from src/main.rs rename to cli/src/main.rs diff --git a/src/util.rs b/cli/src/util.rs similarity index 100% rename from src/util.rs rename to cli/src/util.rs