// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@39364b6 src/uu/ls/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> ls <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
#![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 mod format {
pub static ONE_LINE: &str = "1";
pub static LONG: &str = "long";
pub static COLUMNS: &str = "C";
pub static ACROSS: &str = "x";
pub static TAB_SIZE: &str = "tabsize";
pub static COMMAS: &str = "m";
pub static LONG_NO_OWNER: &str = "g";
pub static LONG_NO_GROUP: &str = "o";
pub static LONG_NUMERIC_UID_GID: &str = "numeric-uid-gid";
}
pub mod files {
pub static ALL: &str = "all";
pub static ALMOST_ALL: &str = "almost-all";
pub static UNSORTED_ALL: &str = "f";
}
pub mod sort {
pub static SIZE: &str = "S";
pub static TIME: &str = "t";
pub static NONE: &str = "U";
pub static VERSION: &str = "v";
pub static EXTENSION: &str = "X";
}
pub mod time {
pub static ACCESS: &str = "u";
pub static CHANGE: &str = "c";
}
pub mod size {
pub static ALLOCATION_SIZE: &str = "size";
pub static BLOCK_SIZE: &str = "block-size";
pub static HUMAN_READABLE: &str = "human-readable";
pub static SI: &str = "si";
pub static KIBIBYTES: &str = "kibibytes";
}
pub mod quoting {
pub static ESCAPE: &str = "escape";
pub static LITERAL: &str = "literal";
pub static C: &str = "quote-name";
}
pub mod indicator_style {
pub static SLASH: &str = "p";
pub static FILE_TYPE: &str = "file-type";
pub static CLASSIFY: &str = "classify";
}
pub mod dereference {
pub static ALL: &str = "dereference";
pub static ARGS: &str = "dereference-command-line";
pub static DIR_ARGS: &str = "dereference-command-line-symlink-to-dir";
}
pub static HELP: &str = "help";
pub static QUOTING_STYLE: &str = "quoting-style";
pub static HIDE_CONTROL_CHARS: &str = "hide-control-chars";
pub static SHOW_CONTROL_CHARS: &str = "show-control-chars";
pub static WIDTH: &str = "width";
pub static AUTHOR: &str = "author";
pub static NO_GROUP: &str = "no-group";
pub static FORMAT: &str = "format";
pub static SORT: &str = "sort";
pub static TIME: &str = "time";
pub static IGNORE_BACKUPS: &str = "ignore-backups";
pub static DIRECTORY: &str = "directory";
pub static INODE: &str = "inode";
pub static REVERSE: &str = "reverse";
pub static RECURSIVE: &str = "recursive";
pub static COLOR: &str = "color";
pub static PATHS: &str = "paths";
pub static INDICATOR_STYLE: &str = "indicator-style";
pub static TIME_STYLE: &str = "time-style";
pub static FULL_TIME: &str = "full-time";
pub static HIDE: &str = "hide";
pub static IGNORE: &str = "ignore";
pub static CONTEXT: &str = "context";
pub static GROUP_DIRECTORIES_FIRST: &str = "group-directories-first";
pub static ZERO: &str = "zero";
pub static DIRED: &str = "dired";
pub static HYPERLINK: &str = "hyperlink";
}
#[allow(unused_imports)]
use options::*;
/// Vendored stand-in for `uucore::format_usage`.
///
/// Upstream wraps the usage line with stylized "Usage:" prefix logic
/// driven by uucore's locale stack. For our purposes the raw string
/// is enough; clap's `override_usage` accepts the literal as-is.
fn format_usage(s: &str) -> String {
s.to_string()
}
/// Sidecar harvest of every `Arg::env(...)` annotation the codegen
/// stripped from the runtime Arg chain (TM-INF-024). Consumed by
/// `crate::builtins::clap_env::apply_env_defaults` so bashkit's
/// virtual `ctx.env` — never `std::env` — drives clap's env-default
/// path. Order matches the chain order in the original `uu_app()`.
pub static LS_ENV_DEFAULTS: &[crate::builtins::clap_env::EnvDefault] = &[
crate::builtins::clap_env::EnvDefault {
arg_id: options::TIME_STYLE,
long: options::TIME_STYLE,
env_var: "TIME_STYLE",
kind: crate::builtins::clap_env::EnvKind::Single,
},
crate::builtins::clap_env::EnvDefault {
arg_id: options::format::TAB_SIZE,
long: options::format::TAB_SIZE,
env_var: "TABSIZE",
kind: crate::builtins::clap_env::EnvKind::Single,
},
];
pub fn ls_command() -> Command {
Command::new("ls")
.version(env!("CARGO_PKG_VERSION"))
.override_usage(
format_usage(&::std::string::String::from("ls [OPTION]... [FILE]...")),
)
.about(
::std::string::String::from(
"List directory contents.\nIgnore files and directories starting with a '.' by default",
),
)
.infer_long_args(true)
.disable_help_flag(true)
.args_override_self(true)
.arg(
Arg::new(options::HELP)
.long(options::HELP)
.help(::std::string::String::from("Print help information."))
.action(ArgAction::Help),
)
.arg(
Arg::new(options::FORMAT)
.long(options::FORMAT)
.help(::std::string::String::from("Set the display format."))
.value_parser(
::clap::builder::PossibleValuesParser::new([
"long",
"verbose",
"single-column",
"columns",
"vertical",
"across",
"horizontal",
"commas",
]),
)
.hide_possible_values(true)
.require_equals(true)
.overrides_with_all([
options::FORMAT,
options::format::COLUMNS,
options::format::LONG,
options::format::ACROSS,
options::format::COLUMNS,
options::DIRED,
]),
)
.arg(
Arg::new(options::format::COLUMNS)
.short('C')
.help(::std::string::String::from("Display the files in columns."))
.overrides_with_all([
options::FORMAT,
options::format::COLUMNS,
options::format::LONG,
options::format::ACROSS,
options::format::COLUMNS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::format::LONG)
.short('l')
.long(options::format::LONG)
.help(::std::string::String::from("Display detailed information."))
.overrides_with_all([
options::FORMAT,
options::format::COLUMNS,
options::format::LONG,
options::format::ACROSS,
options::format::COLUMNS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::format::ACROSS)
.short('x')
.help(
::std::string::String::from(
"List entries in rows instead of in columns.",
),
)
.overrides_with_all([
options::FORMAT,
options::format::COLUMNS,
options::format::LONG,
options::format::ACROSS,
options::format::COLUMNS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::format::TAB_SIZE)
.short('T')
.long(options::format::TAB_SIZE)
.value_name("COLS")
.help(
::std::string::String::from(
"Assume tab stops at each COLS instead of 8",
),
),
)
.arg(
Arg::new(options::format::COMMAS)
.short('m')
.help(::std::string::String::from("List entries separated by commas."))
.overrides_with_all([
options::FORMAT,
options::format::COLUMNS,
options::format::LONG,
options::format::ACROSS,
options::format::COLUMNS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::ZERO)
.long(options::ZERO)
.overrides_with(options::ZERO)
.help(
::std::string::String::from(
"List entries separated by ASCII NUL characters.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::DIRED)
.long(options::DIRED)
.short('D')
.help(
::std::string::String::from(
"generate output designed for Emacs' dired (Directory Editor) mode",
),
)
.action(ArgAction::SetTrue)
.overrides_with(options::HYPERLINK),
)
.arg(
Arg::new(options::HYPERLINK)
.long(options::HYPERLINK)
.help(::std::string::String::from("hyperlink file names WHEN"))
.value_parser(
::clap::builder::PossibleValuesParser::new([
PossibleValue::new("always").alias("yes").alias("force"),
PossibleValue::new("auto").alias("tty").alias("if-tty"),
PossibleValue::new("never").alias("no").alias("none"),
]),
)
.require_equals(true)
.num_args(0..=1)
.default_missing_value("always")
.default_value("never")
.value_name("WHEN")
.overrides_with(options::DIRED),
)
.arg(
Arg::new(options::format::ONE_LINE)
.short('1')
.help(::std::string::String::from("List one file per line."))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::format::LONG_NO_GROUP)
.short('o')
.help(
::std::string::String::from(
"Long format without group information.\nIdentical to --format=long with --no-group.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::format::LONG_NO_OWNER)
.short('g')
.help(
::std::string::String::from("Long format without owner information."),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::format::LONG_NUMERIC_UID_GID)
.short('n')
.long(options::format::LONG_NUMERIC_UID_GID)
.help(::std::string::String::from("-l with numeric UIDs and GIDs."))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(QUOTING_STYLE)
.long(QUOTING_STYLE)
.help(::std::string::String::from("Set quoting style."))
.value_parser(
::clap::builder::PossibleValuesParser::new([
PossibleValue::new("literal"),
PossibleValue::new("locale"),
PossibleValue::new("shell"),
PossibleValue::new("shell-escape"),
PossibleValue::new("shell-always"),
PossibleValue::new("shell-escape-always"),
PossibleValue::new("clocale"),
PossibleValue::new("c").alias("c-maybe"),
PossibleValue::new("escape"),
]),
)
.overrides_with_all([
QUOTING_STYLE,
options::quoting::LITERAL,
options::quoting::ESCAPE,
options::quoting::C,
]),
)
.arg(
Arg::new(options::quoting::LITERAL)
.short('N')
.long(options::quoting::LITERAL)
.alias("l")
.help(
::std::string::String::from(
"Use literal quoting style. Equivalent to `--quoting-style=literal`",
),
)
.overrides_with_all([
QUOTING_STYLE,
options::quoting::LITERAL,
options::quoting::ESCAPE,
options::quoting::C,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::quoting::ESCAPE)
.short('b')
.long(options::quoting::ESCAPE)
.help(
::std::string::String::from(
"Use escape quoting style. Equivalent to `--quoting-style=escape`",
),
)
.overrides_with_all([
QUOTING_STYLE,
options::quoting::LITERAL,
options::quoting::ESCAPE,
options::quoting::C,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::quoting::C)
.short('Q')
.long(options::quoting::C)
.help(
::std::string::String::from(
"Use C quoting style. Equivalent to `--quoting-style=c`",
),
)
.overrides_with_all([
QUOTING_STYLE,
options::quoting::LITERAL,
options::quoting::ESCAPE,
options::quoting::C,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::HIDE_CONTROL_CHARS)
.short('q')
.long(options::HIDE_CONTROL_CHARS)
.help(
::std::string::String::from(
"Replace control characters with '?' if they are not escaped.",
),
)
.overrides_with_all([
options::HIDE_CONTROL_CHARS,
options::SHOW_CONTROL_CHARS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SHOW_CONTROL_CHARS)
.long(options::SHOW_CONTROL_CHARS)
.help(
::std::string::String::from(
"Show control characters 'as is' if they are not escaped.",
),
)
.overrides_with_all([
options::HIDE_CONTROL_CHARS,
options::SHOW_CONTROL_CHARS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::TIME)
.long(options::TIME)
.help(
::std::string::String::from(
"Show time in `<field>`:\naccess time (-u): atime, access, use;\nchange time (-t): ctime, status.\nmodification time: mtime, modification.\nbirth time: birth, creation;",
),
)
.value_name("field")
.value_parser(
::clap::builder::PossibleValuesParser::new([
PossibleValue::new("atime").alias("access").alias("use"),
PossibleValue::new("ctime").alias("status"),
PossibleValue::new("mtime").alias("modification"),
PossibleValue::new("birth").alias("creation"),
]),
)
.hide_possible_values(true)
.require_equals(true)
.overrides_with_all([
options::TIME,
options::time::ACCESS,
options::time::CHANGE,
]),
)
.arg(
Arg::new(options::time::CHANGE)
.short('c')
.help(
::std::string::String::from(
"If the long listing format (e.g., -l, -o) is being used, print the\nstatus change time (the 'ctime' in the inode) instead of the modification\ntime. When explicitly sorting by time (--sort=time or -t) or when not\nusing a long listing format, sort according to the status change time.",
),
)
.overrides_with_all([
options::TIME,
options::time::ACCESS,
options::time::CHANGE,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::time::ACCESS)
.short('u')
.help(
::std::string::String::from(
"If the long listing format (e.g., -l, -o) is being used, print the\nstatus access time instead of the modification time. When explicitly\nsorting by time (--sort=time or -t) or when not using a long listing\nformat, sort according to the access time.",
),
)
.overrides_with_all([
options::TIME,
options::time::ACCESS,
options::time::CHANGE,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::HIDE)
.long(options::HIDE)
.action(ArgAction::Append)
.value_name("PATTERN")
.help(
::std::string::String::from(
"do not list implied entries matching shell PATTERN (overridden by -a or -A)",
),
),
)
.arg(
Arg::new(options::IGNORE)
.short('I')
.long(options::IGNORE)
.action(ArgAction::Append)
.value_name("PATTERN")
.help(
::std::string::String::from(
"do not list implied entries matching shell PATTERN",
),
),
)
.arg(
Arg::new(options::IGNORE_BACKUPS)
.short('B')
.long(options::IGNORE_BACKUPS)
.help(::std::string::String::from("Ignore entries which end with ~."))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SORT)
.long(options::SORT)
.help(
::std::string::String::from(
"Sort by `<field>`: name, none (-U), time (-t), size (-S), extension (-X) or width",
),
)
.value_name("field")
.value_parser(
::clap::builder::PossibleValuesParser::new([
"name",
"none",
"time",
"size",
"version",
"extension",
"width",
]),
)
.require_equals(true)
.overrides_with_all([
options::SORT,
options::sort::SIZE,
options::sort::TIME,
options::sort::NONE,
options::sort::VERSION,
options::sort::EXTENSION,
]),
)
.arg(
Arg::new(options::sort::SIZE)
.short('S')
.help(::std::string::String::from("Sort by file size, largest first."))
.overrides_with_all([
options::SORT,
options::sort::SIZE,
options::sort::TIME,
options::sort::NONE,
options::sort::VERSION,
options::sort::EXTENSION,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::sort::TIME)
.short('t')
.help(
::std::string::String::from(
"Sort by modification time (the 'mtime' in the inode), newest first.",
),
)
.overrides_with_all([
options::SORT,
options::sort::SIZE,
options::sort::TIME,
options::sort::NONE,
options::sort::VERSION,
options::sort::EXTENSION,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::sort::VERSION)
.short('v')
.help(
::std::string::String::from(
"Natural sort of (version) numbers in the filenames.",
),
)
.overrides_with_all([
options::SORT,
options::sort::SIZE,
options::sort::TIME,
options::sort::NONE,
options::sort::VERSION,
options::sort::EXTENSION,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::sort::EXTENSION)
.short('X')
.help(
::std::string::String::from(
"Sort alphabetically by entry extension.",
),
)
.overrides_with_all([
options::SORT,
options::sort::SIZE,
options::sort::TIME,
options::sort::NONE,
options::sort::VERSION,
options::sort::EXTENSION,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::sort::NONE)
.short('U')
.help(
::std::string::String::from(
"Do not sort; list the files in whatever order they are stored in the\ndirectory. This is especially useful when listing very large directories,\nsince not doing any sorting can be noticeably faster.",
),
)
.overrides_with_all([
options::SORT,
options::sort::SIZE,
options::sort::TIME,
options::sort::NONE,
options::sort::VERSION,
options::sort::EXTENSION,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::dereference::ALL)
.short('L')
.long(options::dereference::ALL)
.help(
::std::string::String::from(
"When showing file information for a symbolic link, show information for the\nfile the link references rather than the link itself.",
),
)
.overrides_with_all([
options::dereference::ALL,
options::dereference::DIR_ARGS,
options::dereference::ARGS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::dereference::DIR_ARGS)
.long(options::dereference::DIR_ARGS)
.help(
::std::string::String::from(
"Do not follow symlinks except when they link to directories and are\ngiven as command line arguments.",
),
)
.overrides_with_all([
options::dereference::ALL,
options::dereference::DIR_ARGS,
options::dereference::ARGS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::dereference::ARGS)
.short('H')
.long(options::dereference::ARGS)
.help(
::std::string::String::from(
"Do not follow symlinks except when given as command line arguments.",
),
)
.overrides_with_all([
options::dereference::ALL,
options::dereference::DIR_ARGS,
options::dereference::ARGS,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::NO_GROUP)
.long(options::NO_GROUP)
.short('G')
.help(::std::string::String::from("Do not show group in long format."))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::AUTHOR)
.long(options::AUTHOR)
.help(
::std::string::String::from(
"Show author in long format. On the supported platforms,\nthe author always matches the file owner.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::files::ALL)
.short('a')
.long(options::files::ALL)
.overrides_with_all([options::files::ALL, options::files::ALMOST_ALL])
.help(
::std::string::String::from(
"Do not ignore hidden files (files with names that start with '.').",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::files::ALMOST_ALL)
.short('A')
.long(options::files::ALMOST_ALL)
.overrides_with_all([options::files::ALL, options::files::ALMOST_ALL])
.help(
::std::string::String::from(
"In a directory, do not ignore all file names that start with '.',\nonly ignore '.' and '..'.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::files::UNSORTED_ALL)
.short('f')
.help(
::std::string::String::from(
"List all files in directory order, unsorted. Equivalent to -aU. Disables --color unless explicitly specified.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::DIRECTORY)
.short('d')
.long(options::DIRECTORY)
.help(
::std::string::String::from(
"Only list the names of directories, rather than listing directory contents.\nThis will not follow symbolic links unless one of `--dereference-command-line\n(-H)`, `--dereference (-L)`, or `--dereference-command-line-symlink-to-dir` is\nspecified.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::size::HUMAN_READABLE)
.short('h')
.long(options::size::HUMAN_READABLE)
.help(
::std::string::String::from(
"Print human readable file sizes (e.g. 1K 234M 56G).",
),
)
.overrides_with_all([options::size::BLOCK_SIZE, options::size::SI])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::size::KIBIBYTES)
.short('k')
.long(options::size::KIBIBYTES)
.help(
::std::string::String::from(
"default to 1024-byte blocks for file system usage; used only with -s and per\ndirectory totals",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::size::SI)
.long(options::size::SI)
.help(
::std::string::String::from(
"Print human readable file sizes using powers of 1000 instead of 1024.",
),
)
.overrides_with_all([
options::size::BLOCK_SIZE,
options::size::HUMAN_READABLE,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::size::BLOCK_SIZE)
.long(options::size::BLOCK_SIZE)
.require_equals(true)
.value_name("BLOCK_SIZE")
.help(
::std::string::String::from(
"scale sizes by BLOCK_SIZE when printing them",
),
)
.overrides_with_all([options::size::SI, options::size::HUMAN_READABLE]),
)
.arg(
Arg::new(options::INODE)
.short('i')
.long(options::INODE)
.help(::std::string::String::from("print the index number of each file"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::REVERSE)
.short('r')
.long(options::REVERSE)
.help(
::std::string::String::from(
"Reverse whatever the sorting method is e.g., list files in reverse\nalphabetical order, youngest first, smallest first, or whatever.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::RECURSIVE)
.short('R')
.long(options::RECURSIVE)
.help(
::std::string::String::from(
"List the contents of all directories recursively.",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::WIDTH)
.long(options::WIDTH)
.short('w')
.help(
::std::string::String::from(
"Assume that the terminal is COLS columns wide.",
),
)
.value_name("COLS"),
)
.arg(
Arg::new(options::size::ALLOCATION_SIZE)
.short('s')
.long(options::size::ALLOCATION_SIZE)
.help(
::std::string::String::from(
"print the allocated size of each file, in blocks",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::COLOR)
.long(options::COLOR)
.help(::std::string::String::from("Color output based on file type."))
.value_parser(
::clap::builder::PossibleValuesParser::new([
PossibleValue::new("always").alias("yes").alias("force"),
PossibleValue::new("auto").alias("tty").alias("if-tty"),
PossibleValue::new("never").alias("no").alias("none"),
]),
)
.require_equals(true)
.num_args(0..=1),
)
.arg(
Arg::new(options::INDICATOR_STYLE)
.long(options::INDICATOR_STYLE)
.help(
::std::string::String::from(
"Append indicator with style WORD to entry names:\nnone (default), slash (-p), file-type (--file-type), classify (-F)",
),
)
.value_parser(
::clap::builder::PossibleValuesParser::new([
"none",
"slash",
"file-type",
"classify",
]),
)
.overrides_with_all([
options::indicator_style::FILE_TYPE,
options::indicator_style::SLASH,
options::indicator_style::CLASSIFY,
options::INDICATOR_STYLE,
]),
)
.arg(
Arg::new(options::indicator_style::CLASSIFY)
.short('F')
.long(options::indicator_style::CLASSIFY)
.help(
::std::string::String::from(
"Append a character to each file name indicating the file type. Also, for\nregular files that are executable, append '*'. The file type indicators are\n'/' for directories, '@' for symbolic links, '|' for FIFOs, '=' for sockets,\n'>' for doors, and nothing for regular files. when may be omitted, or one of:\nnone - Do not classify. This is the default.\nauto - Only classify if standard output is a terminal.\nalways - Always classify.\nSpecifying --classify and no when is equivalent to --classify=always. This will\nnot follow symbolic links listed on the command line unless the\n--dereference-command-line (-H), --dereference (-L), or\n--dereference-command-line-symlink-to-dir options are specified.",
),
)
.value_name("when")
.value_parser(
::clap::builder::PossibleValuesParser::new([
PossibleValue::new("always").alias("yes").alias("force"),
PossibleValue::new("auto").alias("tty").alias("if-tty"),
PossibleValue::new("never").alias("no").alias("none"),
]),
)
.default_missing_value("always")
.require_equals(true)
.num_args(0..=1)
.overrides_with_all([
options::indicator_style::FILE_TYPE,
options::indicator_style::SLASH,
options::indicator_style::CLASSIFY,
options::INDICATOR_STYLE,
]),
)
.arg(
Arg::new(options::indicator_style::FILE_TYPE)
.long(options::indicator_style::FILE_TYPE)
.help(
::std::string::String::from(
"Same as --classify, but do not append '*'",
),
)
.overrides_with_all([
options::indicator_style::FILE_TYPE,
options::indicator_style::SLASH,
options::indicator_style::CLASSIFY,
options::INDICATOR_STYLE,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::indicator_style::SLASH)
.short('p')
.help(::std::string::String::from("Append / indicator to directories."))
.overrides_with_all([
options::indicator_style::FILE_TYPE,
options::indicator_style::SLASH,
options::indicator_style::CLASSIFY,
options::INDICATOR_STYLE,
])
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::TIME_STYLE)
.long(options::TIME_STYLE)
.help(
::std::string::String::from(
"time/date format with -l; see TIME_STYLE below",
),
)
.value_name("TIME_STYLE")
.value_parser(NonEmptyStringValueParser::new())
.overrides_with_all([options::TIME_STYLE]),
)
.arg(
Arg::new(options::FULL_TIME)
.long(options::FULL_TIME)
.overrides_with(options::FULL_TIME)
.help(::std::string::String::from("like -l --time-style=full-iso"))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::CONTEXT)
.short('Z')
.long(options::CONTEXT)
.help(
::std::string::String::from(
"print any security context of each file",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::GROUP_DIRECTORIES_FIRST)
.long(options::GROUP_DIRECTORIES_FIRST)
.help(
::std::string::String::from(
"group directories before files; can be augmented with\na --sort option, but any use of --sort=none (-U) disables grouping",
),
)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::PATHS)
.hide(true)
.action(ArgAction::Append)
.value_hint(clap::ValueHint::AnyPath)
.value_parser(ValueParser::os_string()),
)
.after_help(
::std::string::String::from(
"The TIME_STYLE argument can be full-iso, long-iso, iso, locale or +FORMAT. FORMAT is interpreted like in date. Also the TIME_STYLE environment variable sets the default style to use.",
),
)
}