Skip to main content

Module shell

Module shell 

Source
Expand description

Utility functions for writing to stdout and stderr.

Originally from cargo.

Re-exportsยง

use anstream::AutoStream; ๐Ÿ”’
use anstyle::Style; ๐Ÿ”’
use clap::ValueEnum; ๐Ÿ”’
use eyre::Result; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use std::fmt; ๐Ÿ”’
use std::io::IsTerminal; ๐Ÿ”’
use std::ops::DerefMut; ๐Ÿ”’
use std::sync::Mutex; ๐Ÿ”’
use std::sync::OnceLock; ๐Ÿ”’
use std::sync::PoisonError; ๐Ÿ”’
use std::sync::atomic::AtomicBool; ๐Ÿ”’
use std::sync::atomic::Ordering; ๐Ÿ”’
use super::style::*; ๐Ÿ”’
use std::io::prelude::*; ๐Ÿ”’

Structsยง

Shell
An abstraction around console output that remembers preferences for output verbosity and color.

Enumsยง

ColorChoice
Whether messages should use color output.
OutputFormat
The requested output format.
OutputMode
The requested output mode.
ShellOut ๐Ÿ”’
A Writeable object, either with or without color support.

Staticsยง

GLOBAL_SHELL ๐Ÿ”’
The global shell instance.

Functionsยง

color_choice
Returns the current color choice.
is_err_tty
Returns whether stderr is a terminal (tty).
is_json
Returns whether the output format is OutputFormat::Json.
is_markdown
Returns whether the output format is OutputFormat::Markdown.
is_out_tty
Returns whether stdout is a terminal (tty).
is_quiet
Returns whether the output mode is OutputMode::Quiet.
set_verbosity
Set the verbosity level.
supports_color ๐Ÿ”’
verbosity
Returns the currently set verbosity level.

Type Aliasesยง

Verbosity
The verbosity level.