mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
Separate lib from binary
Makes integration testing easier
This commit is contained in:
parent
78d5f435ee
commit
aa03d2723e
18
src/lib.rs
Normal file
18
src/lib.rs
Normal file
@ -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
src/main.rs
25
src/main.rs
@ -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() {
|
||||
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user