pijul 1.0.0-alpha.9

The sound distributed version control system.
mod init;
pub use init::Init;

mod clone;
pub use clone::Clone;

mod pushpull;
pub use pushpull::*;

mod log;
pub use self::log::Log;

mod record;
pub use record::Record;

mod diff;
pub use diff::Diff;

mod change;
pub use change::Change;

mod protocol;
pub use protocol::Protocol;

#[cfg(feature = "git")]
mod git;
#[cfg(feature = "git")]
pub use git::Git;

mod channel;
pub use channel::*;

mod reset;
pub use reset::*;

mod fork;
pub use fork::*;

mod unrecord;
pub use unrecord::*;

mod file_operations;
pub use file_operations::*;

mod apply;
pub use apply::*;

mod archive;
pub use archive::*;

mod credit;
pub use credit::*;

#[cfg(debug_assertions)]
mod debug;
#[cfg(debug_assertions)]
pub use debug::*;

mod upgrade;
pub use upgrade::*;

/// Initializes a pager for use in some subcommands (e.g. diff, log).
/// The pager immediately quits if the output fits on one screen and
/// displays control characters. It is ignored if the output we're
/// writing to is not a TTY.
fn initialize_pager() -> pager::Pager {
    let mut pager = pager::Pager::with_pager("less -Fr");
    pager.setup();
    pager
}

/// Determine whether we should emit colored output. True if either we
/// started the pager (so we know it can read color codes) or stdout
/// is a TTY, and the environment variable [`NO_COLOR`] is unset;
/// otherwise, false.
///
/// [`NO_COLOR`]: http://no-color.org/
fn use_colors(pager: &pager::Pager) -> bool {
    (pager.is_on() || atty::is(atty::Stream::Stdout)) && std::env::var("NO_COLOR").is_err()
}