quicli/
lib.rs

1//! Some tools to get you started with writing small CLIs in Rust.
2//!
3//! You can find some examples and more information on how to use this crate
4//! in the [README](https://github.com/killercup/quicli).
5
6#![deny(missing_docs)]
7
8#[cfg(feature = "full-throttle")]
9pub mod fs;
10
11mod reexports {
12    #[cfg(feature = "full-throttle")]
13    #[doc(hidden)]
14    pub use serde_derive::{Deserialize, Serialize};
15
16    pub use clap_verbosity_flag::Verbosity;
17
18    #[doc(hidden)]
19    pub use failure_derive::Fail;
20    #[doc(hidden)]
21    pub use failure::{Error, ResultExt, bail, ensure, format_err, err_msg};
22
23    #[doc(hidden)]
24    pub use log::{error, warn, info, debug, trace, log_enabled};
25
26    #[cfg(feature = "full-throttle")]
27    pub use rayon::prelude::*;
28
29    #[doc(hidden)]
30    pub use log;
31    #[doc(hidden)]
32    pub use log::Level as LogLevel;
33}
34
35/// Prelude – import all of this
36///
37/// To get up-and-running _real_ fast, do `use quicli::prelude::*`. It's just
38/// like `use std::io::prelude::*` but with less I/O and more C/L/I!
39///
40/// (If you don't like glob imports, feel free to import the items 1-by-1. You
41/// will sadly miss out on a bunch of derive macros, though.)
42pub mod prelude {
43    pub use crate::reexports::*;
44
45    /// A handy alias for `Result` that carries a generic error type.
46    pub type CliResult = ::std::result::Result<(), ::exitfailure::ExitFailure>;
47
48    #[cfg(feature = "full-throttle")]
49    pub use crate::fs::*;
50}