From 56f11424dc2947f73669a9f7b489555123b2c079 Mon Sep 17 00:00:00 2001 From: Crypto-Spartan <29098151+Crypto-Spartan@users.noreply.github.com> Date: Thu, 13 Jan 2022 13:13:12 -0500 Subject: [PATCH] remove lib.rs and move contents to main.rs (#241) --- src/lib.rs | 29 ----------------------------- src/main.rs | 24 ++++++++++++++++++++++-- 2 files changed, 22 insertions(+), 31 deletions(-) delete mode 100644 src/lib.rs diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 76a8460..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,29 +0,0 @@ -//! This library is just meant to supply needs for the `ouch` binary crate. - -#![warn(missing_docs)] -// Bare URLs in doc comments are not a problem since this project is primarily -// used as a binary. Since `clap` doesn't remove URL markup in it's help output, -// we don't mark them as URLs. This suppresses the relevant rustdoc warning: -#![allow(rustdoc::bare_urls)] - -// Macros should be declared before -pub mod macros; - -pub mod archive; -pub mod cli; -pub mod commands; -pub mod error; -pub mod extension; -pub mod list; -pub mod progress; -pub mod utils; - -/// CLI argparsing definitions, using `clap`. -pub mod opts; - -pub use error::{Error, Result}; -pub use opts::{Opts, Subcommand}; -pub use utils::{QuestionAction, QuestionPolicy}; - -/// The status code returned from `ouch` on error -pub const EXIT_FAILURE: i32 = libc::EXIT_FAILURE; diff --git a/src/main.rs b/src/main.rs index a8b2d3f..97426b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,29 @@ -use ouch::{commands, Opts, Result}; +// Macros should be declared first +pub mod macros; + +pub mod archive; +pub mod cli; +pub mod commands; +pub mod error; +pub mod extension; +pub mod list; +pub mod progress; +pub mod utils; + +/// CLI argparsing definitions, using `clap`. +pub mod opts; + +use error::{Error, Result}; +use opts::{Opts, Subcommand}; +use utils::{QuestionAction, QuestionPolicy}; + +/// The status code returned from `ouch` on error +pub const EXIT_FAILURE: i32 = libc::EXIT_FAILURE; fn main() { if let Err(err) = run() { eprintln!("{}", err); - std::process::exit(ouch::EXIT_FAILURE); + std::process::exit(EXIT_FAILURE); } }