mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +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;
|
use ouch::{
|
||||||
mod cli;
|
cli::{parse_args, ParsedArgs},
|
||||||
mod compressors;
|
evaluator::Evaluator,
|
||||||
mod decompressors;
|
Result,
|
||||||
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;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if let Err(err) = run() {
|
if let Err(err) = run() {
|
||||||
@ -25,6 +12,6 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn run() -> crate::Result<()> {
|
fn run() -> crate::Result<()> {
|
||||||
let ParsedArgs { command, flags } = cli::parse_args()?;
|
let ParsedArgs { command, flags } = parse_args()?;
|
||||||
Evaluator::evaluate(command, &flags)
|
Evaluator::evaluate(command, &flags)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user