#![allow(unused_imports, dead_code)]
use clap::builder::{
NonEmptyStringValueParser, PossibleValue, PossibleValuesParser, TypedValueParser, ValueParser,
ValueParserFactory,
};
use clap::{Arg, ArgAction, Command};
use std::ffi::{OsStr, OsString};
use std::ops::RangeInclusive;
use std::path::PathBuf;
use std::str::FromStr;
pub mod options {
pub const APPEND: &str = "append";
pub const IGNORE_INTERRUPTS: &str = "ignore-interrupts";
pub const FILE: &str = "file";
pub const IGNORE_PIPE_ERRORS: &str = "ignore-pipe-errors";
pub const OUTPUT_ERROR: &str = "output-error";
}
#[allow(unused_imports)]
use options::*;
fn format_usage(s: &str) -> String {
s.to_string()
}
pub static TEE_ENV_DEFAULTS: &[crate::builtins::clap_env::EnvDefault] = &[];
pub fn tee_command() -> Command {
Command::new("tee")
.version(env!("CARGO_PKG_VERSION"))
.about(
::std::string::String::from(
"Copy standard input to each FILE, and also to standard output.",
),
)
.override_usage(
format_usage(&::std::string::String::from("tee [OPTION]... [FILE]...")),
)
.after_help(
::std::string::String::from("If a FILE is -, it refers to a file named - ."),
)
.infer_long_args(true)
.disable_help_flag(true)
.arg(
Arg::new("--help")
.short('h')
.long("help")
.help(::std::string::String::from("Print help"))
.action(ArgAction::HelpLong),
)
.arg(
Arg::new(options::APPEND)
.long(options::APPEND)
.short('a')
.help(
::std::string::String::from(
"append to the given FILEs, do not overwrite",
),
)
.action(ArgAction::SetTrue)
.overrides_with(options::APPEND),
)
.arg(
Arg::new(options::IGNORE_INTERRUPTS)
.long(options::IGNORE_INTERRUPTS)
.short('i')
.help(
::std::string::String::from(
"ignore interrupt signals (ignored on non-Unix platforms)",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::FILE)
.action(ArgAction::Append)
.value_hint(clap::ValueHint::FilePath)
.value_parser(clap::value_parser!(OsString)),
)
.arg(
Arg::new(options::IGNORE_PIPE_ERRORS)
.short('p')
.help(
::std::string::String::from(
"set write error behavior (ignored on non-Unix platforms)",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::OUTPUT_ERROR)
.long(options::OUTPUT_ERROR)
.require_equals(true)
.num_args(0..=1)
.default_missing_value("warn-nopipe")
.value_parser(
::clap::builder::PossibleValuesParser::new([
PossibleValue::new("warn")
.help(
::std::string::String::from(
"produce warnings for errors writing to any output",
),
),
PossibleValue::new("warn-nopipe")
.help(
::std::string::String::from(
"produce warnings for errors that are not pipe errors (ignored on non-unix platforms)",
),
),
PossibleValue::new("exit")
.help(
::std::string::String::from(
"exit on write errors to any output",
),
),
PossibleValue::new("exit-nopipe")
.help(
::std::string::String::from(
"exit on write errors to any output that are not pipe errors (equivalent to exit on non-unix platforms)",
),
),
]),
)
.help(::std::string::String::from("set write error behavior")),
)
}