Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update master from dev #20

Merged
merged 11 commits into from
Apr 7, 2021
Prev Previous commit
Next Next commit
Separate lib from binary
Makes integration testing easier
  • Loading branch information
marcospb19 committed Apr 6, 2021
commit aa03d2723e3ed56b0cd3859fbd786313fcf147ca
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Public modules
pub mod cli;
pub mod evaluator;

// Private modules
mod bytes;
mod compressors;
mod decompressors;
mod dialogs;
mod error;
mod extension;
mod file;
mod test;
mod utils;

const VERSION: &str = "0.1.5";

pub use error::{Error, Result};
25 changes: 6 additions & 19 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
mod bytes;
mod cli;
mod compressors;
mod decompressors;
mod dialogs;
mod error;
mod evaluator;
mod extension;
mod file;
mod test;
mod utils;

pub const VERSION: &str = "0.1.5";

use error::{Error, Result};
use evaluator::Evaluator;

use crate::cli::ParsedArgs;
use ouch::{
cli::{parse_args, ParsedArgs},
evaluator::Evaluator,
Result,
};

fn main() {
if let Err(err) = run() {
Expand All @@ -25,6 +12,6 @@ fn main() {
}

fn run() -> crate::Result<()> {
let ParsedArgs { command, flags } = cli::parse_args()?;
let ParsedArgs { command, flags } = parse_args()?;
Evaluator::evaluate(command, &flags)
}