#![allow(unused_imports, dead_code)]
use clap::{Arg, ArgAction, Command, builder::ValueParser};
use std::ffi::OsString;
use std::ops::RangeInclusive;
use std::str::FromStr;
mod options {
pub static FILE: &str = "file";
pub static SHOW_ALL: &str = "show-all";
pub static NUMBER_NONBLANK: &str = "number-nonblank";
pub static SHOW_NONPRINTING_ENDS: &str = "e";
pub static SHOW_ENDS: &str = "show-ends";
pub static NUMBER: &str = "number";
pub static SQUEEZE_BLANK: &str = "squeeze-blank";
pub static SHOW_NONPRINTING_TABS: &str = "t";
pub static SHOW_TABS: &str = "show-tabs";
pub static SHOW_NONPRINTING: &str = "show-nonprinting";
pub static IGNORED_U: &str = "ignored-u";
}
fn format_usage(s: &str) -> String {
s.to_string()
}
pub fn cat_command() -> Command {
Command::new("cat")
.version(env!("CARGO_PKG_VERSION"))
.override_usage(
format_usage(&::std::string::String::from("cat [OPTION]... [FILE]...")),
)
.about(
::std::string::String::from(
"Concatenate FILE(s), or standard input, to standard output\nWith no FILE, or when FILE is -, read standard input.",
),
)
.infer_long_args(true)
.args_override_self(true)
.arg(
Arg::new(options::FILE)
.hide(true)
.action(ArgAction::Append)
.value_parser(clap::value_parser!(OsString))
.default_value("-")
.value_hint(clap::ValueHint::FilePath),
)
.arg(
Arg::new(options::SHOW_ALL)
.short('A')
.long(options::SHOW_ALL)
.help(::std::string::String::from("equivalent to -vET"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::NUMBER_NONBLANK)
.short('b')
.long(options::NUMBER_NONBLANK)
.help(
::std::string::String::from(
"number nonempty output lines, overrides -n",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SHOW_NONPRINTING_ENDS)
.short('e')
.help(::std::string::String::from("equivalent to -vE"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SHOW_ENDS)
.short('E')
.long(options::SHOW_ENDS)
.help(::std::string::String::from("display $ at end of each line"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::NUMBER)
.short('n')
.long(options::NUMBER)
.help(::std::string::String::from("number all output lines"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SQUEEZE_BLANK)
.short('s')
.long(options::SQUEEZE_BLANK)
.help(
::std::string::String::from("suppress repeated empty output lines"),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SHOW_NONPRINTING_TABS)
.short('t')
.help(::std::string::String::from("equivalent to -vT"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SHOW_TABS)
.short('T')
.long(options::SHOW_TABS)
.help(::std::string::String::from("display TAB characters at ^I"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SHOW_NONPRINTING)
.short('v')
.long(options::SHOW_NONPRINTING)
.help(
::std::string::String::from(
"use ^ and M- notation, except for LF (\\n) and TAB (\\t)",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::IGNORED_U)
.short('u')
.help(::std::string::String::from("(ignored)"))
.action(ArgAction::SetTrue),
)
}