Also, the method initialize_pager
has been replaced by initialize_stdout
that provides an stdout stream with correct color settings and pager.
EGEH2NKBUZMZAYWIDRNLCQMQHK64TTPH2N6O4DJDDQODY545TBSQC
QE2TAMCXQE5HXRRMA5Z6GCIH3I2KFA22GWYPLXJEEB6RI6S6INMQC
Q45QHPO4HDTEZF2W4UDZSYYQ46BPEIWSW4GJILZR5HTJNLKXJABQC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
L4JXJHWXYNCL4QGJXNKKTOKKTAXKKXBJUUY7HFZGEUZ5A2V5H34QC
I52XSRUH5RVHQBFWVMAQPTUSPAJ4KNVID2RMI3UGCVKFLYUO6WZAC
Q4SVMHAEZQQCBFGPJMWS5H4VXB2HFQREZ3AWGOHFWHLFARUQVPBAC
VIHXB7SGRETFPHPYZFSRGOFRXEO4RZY57WDZSU6IAUEJRU3HPKQAC
G734WNM64AR5BLAZMN5MDPKSFTYXTUQR6MAGB32NRBC5FXFRWSJAC
/// 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() {
let mut pager = pager::Pager::with_pager("less -Fr");
/// Initializes an stdout stream. This stream will redirect to a
/// pager that interprets ANSI color codes and quits immediately
/// if the output fits on one screen. If the output target is a
/// TTY (or the aforementioned pager), the decision whether to
/// output color is left to
/// `termcolor` (see [here](https://docs.rs/termcolor/1.1.2/\
/// termcolor/enum.ColorChoice.html#variant.Auto)), otherwise
/// color output is disabled.
fn initialize_stdout() -> termcolor::StandardStream {
let mut pager = pager::Pager::with_pager("less -FR");
use std::collections::BTreeMap;
use std::io::Write;
use std::path::PathBuf;
use termcolor::{ColorChoice, StandardStream};
use super::initialize_pager;
use super::initialize_stdout;
let o = StandardStream::stdout(ColorChoice::Auto);
let mut o = o.lock();
initialize_pager();
change.write(&changes, Some(hash), file_name, true, &mut o)?;
let stdout = initialize_stdout();
let mut stdout = stdout.lock();
change.write(&changes, Some(hash), file_name, true, &mut stdout)?;
};
"console" = rec {
crateName = "console";
version = "0.13.0";
edition = "2018";
sha256 = "022ai0jbbawngrx396qppwgzk4pk3v2fdwckzamvz6h154jsn2m5";
authors = [
"Armin Ronacher <armin.ronacher@active-4.com>"
];
dependencies = [
{
name = "encode_unicode";
packageId = "encode_unicode";
target = { target, features }: target."windows";
}
{
name = "lazy_static";
packageId = "lazy_static";
}
{
name = "libc";
packageId = "libc";
}
{
name = "regex";
packageId = "regex";
optional = true;
usesDefaultFeatures = false;
features = [ "std" ];
}
{
name = "terminal_size";
packageId = "terminal_size";
}
{
name = "unicode-width";
packageId = "unicode-width";
optional = true;
}
{
name = "winapi";
packageId = "winapi 0.3.9";
target = { target, features }: target."windows";
features = [ "winbase" "winuser" "consoleapi" "processenv" "wincon" ];
}
{
name = "winapi-util";
packageId = "winapi-util";
optional = true;
target = { target, features }: target."windows";
}
];
features = {
"ansi-parsing" = [ "regex" ];
"default" = [ "unicode-width" "ansi-parsing" "windows-console-colors" ];
"windows-console-colors" = [ "ansi-parsing" "winapi-util" ];
};
resolvedDefaultFeatures = [ "ansi-parsing" "default" "regex" "unicode-width" "winapi-util" "windows-console-colors" ];
"encode_unicode" = rec {
crateName = "encode_unicode";
version = "0.3.6";
edition = "2015";
sha256 = "07w3vzrhxh9lpjgsg2y5bwzfar2aq35mdznvcp3zjl0ssj7d4mx3";
authors = [
"Torbjørn Birch Moltu <t.b.moltu@lyse.net>"
];
features = {
"default" = [ "std" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"indicatif" = rec {
crateName = "indicatif";
version = "0.15.0";
edition = "2018";
sha256 = "1r4n50mclyi4c7b9c9mlma1rhchjamw71r3z8vgqcmp24mhvbakv";
authors = [
"Armin Ronacher <armin.ronacher@active-4.com>"
];
dependencies = [
{
name = "console";
packageId = "console";
}
{
name = "lazy_static";
packageId = "lazy_static";
}
{
name = "number_prefix";
packageId = "number_prefix";
}
{
name = "regex";
packageId = "regex";
usesDefaultFeatures = false;
features = [ "std" ];
}
];
features = {
"improved_unicode" = [ "unicode-segmentation" "unicode-width" "console/unicode-width" ];
"with_rayon" = [ "rayon" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"number_prefix" = rec {
crateName = "number_prefix";
version = "0.3.0";
edition = "2015";
sha256 = "0slm4mqmpgs6hvz22ycny9lvyvl9ivs80a1lncslp7lszz02zc0p";
authors = [
"Benjamin Sago <ogham@bsago.me>"
];
features = {
"default" = [ "std" ];
};
resolvedDefaultFeatures = [ "default" "std" ];
};
"terminal_size" = rec {
crateName = "terminal_size";
version = "0.1.15";
edition = "2018";
sha256 = "1qfb07d040wh3m4yfnbxknda7i5fr56ypnwdwdgmzb1zpn1x3ljb";
authors = [
"Andrew Chin <achin@eminence32.net>"
];
dependencies = [
{
name = "libc";
packageId = "libc";
target = { target, features }: (!target."windows");
}
{
name = "winapi";
packageId = "winapi 0.3.9";
target = { target, features }: target."windows";
features = [ "handleapi" "processenv" "winbase" "wincon" "winnt" ];
}
];
};
resolvedDefaultFeatures = [ "basetsd" "consoleapi" "errhandlingapi" "fileapi" "handleapi" "impl-debug" "impl-default" "knownfolders" "libloaderapi" "lmcons" "memoryapi" "minschannel" "minwinbase" "minwindef" "ntdef" "ntstatus" "objbase" "processenv" "processthreadsapi" "profileapi" "schannel" "securitybaseapi" "shlobj" "sspi" "std" "sysinfoapi" "timezoneapi" "winbase" "wincon" "wincrypt" "winerror" "winnt" "winreg" "winsock2" "ws2def" "ws2ipdef" "ws2tcpip" ];
resolvedDefaultFeatures = [ "basetsd" "consoleapi" "errhandlingapi" "fileapi" "handleapi" "impl-debug" "impl-default" "knownfolders" "libloaderapi" "lmcons" "memoryapi" "minschannel" "minwinbase" "minwindef" "ntdef" "ntstatus" "objbase" "processenv" "processthreadsapi" "profileapi" "schannel" "securitybaseapi" "shlobj" "sspi" "std" "sysinfoapi" "timezoneapi" "winbase" "wincon" "wincrypt" "winerror" "winnt" "winreg" "winsock2" "winuser" "ws2def" "ws2ipdef" "ws2tcpip" ];