1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Copyright (C) 2017  Garrett Berg <@vitiral, vitiral@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * */

//! `use stdcli::prelude::*;` is considered the standard way to use this library.
//!
//! This contains the primary modules, traits, structs, and functions so that
//! you can get codding in your cli.
//!
//! # Modules
//!
//! - `console`, `dialoguer` : contains the `Term` type and other various types, which allows you to write pretty
//!   things to your console/terminal.
//! - `ctrlc`: the main function is `ctrlc::set_handler`, which allows you to handle ctrlc signals.

// Reexport std_prelude
pub use std_prelude::*;

// Modules
pub use chrono;
pub use ctrlc;
#[cfg(feature="logging")]
pub use fern;
pub use itertools;
pub use libc;
pub use rayon;  // traits already implemented, this is mostly for `rayon::join` API
pub use regex;  // regex::escape, regex::Error
pub use reqwest; // single request with `reqwest::get`, client connection with `reqwest::Client`
pub use serde;
pub use serde_json;
pub use serde_yaml;
pub use tar;
pub use toml;
pub use walkdir;

// ------------------------------
// -- Traits
pub use itertools::Itertools;
pub use failure::{Fail, ResultExt};
pub use rand::{Rand, Rng, SeedableRng};
pub use rayon::prelude::*;
pub use regex::Replacer;
pub use serde::{Deserialize, Serialize};
pub use shellexpand;
pub use structopt::StructOpt;

// ------------------------------
// -- Structs / Enums
pub use itertools::{Either, EitherOrBoth};
pub use failure::Error;
pub use regex::Regex;
pub use reqwest::Url;
pub use semver::{Version, VersionReq};
pub use tempdir::TempDir;  // the only thing exported by tempdir
pub use walkdir::WalkDir;  // basically the only type of note from walkdir

// ------------------------------
// -- Functions
pub use failure::err_msg;
pub use rand::{random, thread_rng, weak_rng};
#[cfg(feature="logging")]
pub use init_log;