diff --git a/Cargo.toml b/Cargo.toml index 07b53c0..3c20e19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = [ "hammond-data", + "hammond-cli", "other" ] diff --git a/hammond-cli/Cargo.toml b/hammond-cli/Cargo.toml index 0cea7f8..691c422 100644 --- a/hammond-cli/Cargo.toml +++ b/hammond-cli/Cargo.toml @@ -4,3 +4,13 @@ version = "0.1.0" authors = ["Jordan Petridis "] [dependencies] +log = "0.3.8" +loggerv = "0.3.0" +structopt = "0.1.0" +structopt-derive = "0.1.0" +error-chain = "0.11.0" +hammond-data = {path = "../hammond-data"} +other = {path = "../other"} + +[dev-dependencies] +assert_cli = "0.5" \ No newline at end of file diff --git a/other/src/main.rs b/hammond-cli/src/main.rs similarity index 99% rename from other/src/main.rs rename to hammond-cli/src/main.rs index 6edf81e..2e94ba5 100644 --- a/other/src/main.rs +++ b/hammond-cli/src/main.rs @@ -4,19 +4,18 @@ extern crate loggerv; extern crate structopt; #[macro_use] extern crate structopt_derive; - #[macro_use] extern crate error_chain; -extern crate hammond_data; extern crate other; +extern crate hammond_data; use structopt::StructOpt; use hammond_data::dbqueries; use other::errors::*; use other::downloader; use other::index_feed; - + // Should probably had made an Enum instead. #[derive(StructOpt, Debug)] #[structopt(name = "example", about = "An example of StructOpt usage.")] diff --git a/other/tests/test_cli.rs b/hammond-cli/tests/test_cli.rs similarity index 84% rename from other/tests/test_cli.rs rename to hammond-cli/tests/test_cli.rs index e480682..4ef076e 100644 --- a/other/tests/test_cli.rs +++ b/hammond-cli/tests/test_cli.rs @@ -1,5 +1,4 @@ extern crate assert_cli; -extern crate other; // Notes: // The following tests will use your systems local hammond db. @@ -29,3 +28,10 @@ fn test_add() { ]) .unwrap(); } + +#[test] +fn test_latest() { + assert_cli::Assert::main_binary() + .with_args(&["--latest"]) + .unwrap(); +} \ No newline at end of file diff --git a/other/Cargo.toml b/other/Cargo.toml index 352e8b3..04874ea 100644 --- a/other/Cargo.toml +++ b/other/Cargo.toml @@ -7,18 +7,15 @@ authors = ["Jordan Petridis "] hammond-data = {path = "../hammond-data"} rayon = "0.8.2" error-chain = "0.11.0" -structopt = "0.1.0" -structopt-derive = "0.1.0" log = "0.3.8" loggerv = "0.3.0" rfc822_sanitizer = "0.3.0" reqwest = "0.7.3" hyper = "0.11.2" -diesel = { version = "0.16.0", features = ["sqlite", "deprecated-time", "chrono"] } +diesel = { version = "0.16.0", features = ["sqlite"] } diesel_codegen = { version = "0.16.0", features = ["sqlite"] } rss = { version = "1.1.0", features = ["from_url"]} dotenv = "*" [dev-dependencies] tempdir = "0.3.5" -assert_cli = "0.5" diff --git a/other/src/errors.rs b/other/src/errors.rs index 5f989c5..295795e 100644 --- a/other/src/errors.rs +++ b/other/src/errors.rs @@ -16,4 +16,4 @@ error_chain! { HyperError(hyper::error::Error); HamDBError(hammond_data::errors::Error); } -} \ No newline at end of file +} diff --git a/other/src/lib.rs b/other/src/lib.rs index a329db0..8a5760f 100644 --- a/other/src/lib.rs +++ b/other/src/lib.rs @@ -1,6 +1,8 @@ #![recursion_limit = "1024"] extern crate diesel; +#[macro_use] +extern crate error_chain; extern crate hammond_data; extern crate hyper; #[macro_use] @@ -9,10 +11,8 @@ extern crate rayon; extern crate reqwest; extern crate rfc822_sanitizer; extern crate rss; -#[macro_use] -extern crate error_chain; pub mod feedparser; pub mod downloader; pub mod index_feed; -pub mod errors; \ No newline at end of file +pub mod errors;