Explorar o código

Extract CLI logic to a child project

timvisee %!s(int64=7) %!d(string=hai) anos
pai
achega
7a56dabd39

+ 9 - 9
Cargo.lock

@@ -176,15 +176,6 @@ name = "fake-simd"
 version = "0.1.2"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 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]]
 [[package]]
 name = "ffsend-api"
 name = "ffsend-api"
 version = "0.1.0"
 version = "0.1.0"
@@ -203,6 +194,15 @@ dependencies = [
  "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "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]]
 [[package]]
 name = "foreign-types"
 name = "foreign-types"
 version = "0.3.2"
 version = "0.3.2"

+ 4 - 14
Cargo.toml

@@ -1,15 +1,5 @@
-[package]
-name = "ffsend"
-version = "0.1.0"
-authors = ["timvisee <timvisee@gmail.com>"]
-
-[[bin]]
-name = "ffsend"
-
 [workspace]
 [workspace]
-members = ["api"]
-
-[dependencies]
-clap = "2.31"
-ffsend-api = { version = "*", path = "api" }
-open = "1"
+members = [
+    "api",
+    "cli",
+]

+ 13 - 0
cli/Cargo.toml

@@ -0,0 +1,13 @@
+[package]
+name = "ffsend-cli"
+version = "0.1.0"
+authors = ["timvisee <timvisee@gmail.com>"]
+
+[[bin]]
+path = "src/main.rs"
+name = "ffsend"
+
+[dependencies]
+clap = "2.31"
+ffsend-api = { version = "*", path = "../api" }
+open = "1"

+ 0 - 0
src/action/mod.rs → cli/src/action/mod.rs


+ 0 - 0
src/action/upload.rs → cli/src/action/upload.rs


+ 0 - 0
src/app.rs → cli/src/app.rs


+ 0 - 0
src/cmd/cmd_upload.rs → cli/src/cmd/cmd_upload.rs


+ 0 - 0
src/cmd/handler.rs → cli/src/cmd/handler.rs


+ 0 - 0
src/cmd/mod.rs → cli/src/cmd/mod.rs


+ 0 - 0
src/main.rs → cli/src/main.rs


+ 0 - 0
src/util.rs → cli/src/util.rs