#![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;
mod options {
pub const DEREFERENCE: &str = "dereference";
pub const FILE_SYSTEM: &str = "file-system";
pub const FORMAT: &str = "format";
pub const PRINTF: &str = "printf";
pub const TERSE: &str = "terse";
pub const FILES: &str = "files";
}
#[allow(unused_imports)]
use options::*;
fn format_usage(s: &str) -> String {
s.to_string()
}
pub static STAT_ENV_DEFAULTS: &[crate::builtins::clap_env::EnvDefault] = &[];
pub fn stat_command() -> Command {
Command::new("stat")
.version(env!("CARGO_PKG_VERSION"))
.about(::std::string::String::from("Display file or file system status."))
.after_help(
::std::string::String::from(
"Valid format sequences for files (without `--file-system`):",
),
)
.override_usage(
format_usage(&::std::string::String::from("stat [OPTION]... FILE...")),
)
.infer_long_args(true)
.arg(
Arg::new(options::DEREFERENCE)
.short('L')
.long(options::DEREFERENCE)
.help(::std::string::String::from("follow links"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::FILE_SYSTEM)
.short('f')
.long(options::FILE_SYSTEM)
.help(
::std::string::String::from(
"display file system status instead of file status",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::TERSE)
.short('t')
.long(options::TERSE)
.help(::std::string::String::from("print the information in terse form"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::FORMAT)
.short('c')
.long(options::FORMAT)
.help(
::std::string::String::from(
"use the specified FORMAT instead of the default;\noutput a newline after each use of FORMAT",
),
)
.value_name("FORMAT"),
)
.arg(
Arg::new(options::PRINTF)
.long(options::PRINTF)
.value_name("FORMAT")
.help(
::std::string::String::from(
"like --format, but interpret backslash escapes,\nand do not output a mandatory trailing newline;\nif you want a newline, include \\n in FORMAT",
),
),
)
.arg(
Arg::new(options::FILES)
.action(ArgAction::Append)
.value_parser(ValueParser::os_string())
.value_hint(clap::ValueHint::FilePath),
)
}