Make all the option descriptions the same

The old option descriptions were all written at different times, and needed some consistency. This makes everything consistent between the help text, README, man page, and shell completions, and fixes some mistakes made when writing them.

This also adds the missing options to the man page, fixing #175.
This commit is contained in:
Benjamin Sago 2017-05-06 23:00:45 +01:00
parent ad85f3d023
commit e2f73927c7
6 changed files with 149 additions and 135 deletions

View File

@ -14,21 +14,21 @@ exas options are similar, but not exactly the same, as `ls`.
### Display Options ### Display Options
- **-1**, **--oneline**: display one entry per line - **-1**, **--oneline**: display one entry per line
- **-G**, **--grid**: display entries in a grid view (default) - **-G**, **--grid**: display entries as a grid (default)
- **-l**, **--long**: display extended details and attributes - **-l**, **--long**: display extended details and attributes
- **-R**, **--recurse**: recurse into directories - **-R**, **--recurse**: recurse into directories
- **-T**, **--tree**: recurse into subdirectories in a tree view - **-T**, **--tree**: recurse into directories as a tree
- **-x**, **--across**: sort multi-column view entries across - **-x**, **--across**: sort the grid across, rather than downwards
- **--color**, **--colour**: when to colourise the output - **--colo[u]r**: when to use terminal colours
- **--color-scale**, **--colour-scale**: colour file sizes according to their magnitude - **--colo[u]r-scale**: highlight levels of file sizes distinctly
### Filtering Options ### Filtering Options
- **-a**, **--all**: show dot files - **-a**, **--all**: don't hide hidden and 'dot' files
- **-d**, **--list-dirs**: list directories as regular files - **-d**, **--list-dirs**: list directories like regular files
- **-L**, **--level=(depth)**: maximum depth of recursion - **-L**, **--level=(depth)**: limit the depth of recursion
- **-r**, **--reverse**: reverse sort order - **-r**, **--reverse**: reverse the sort order
- **-s**, **--sort=(field)**: field to sort by - **-s**, **--sort=(field)**: which field to sort by
- **--group-directories-first**: list directories before other files - **--group-directories-first**: list directories before other files
- **-I**, **--ignore-glob=(globs)**: glob patterns (pipe-separated) of files to ignore - **-I**, **--ignore-glob=(globs)**: glob patterns (pipe-separated) of files to ignore
@ -36,23 +36,23 @@ exas options are similar, but not exactly the same, as `ls`.
These options are available when running with --long (`-l`): These options are available when running with --long (`-l`):
- **-b**, **--binary**: use binary (power of two) file sizes - **-b**, **--binary**: list file sizes with binary prefixes
- **-B**, **--bytes**: list file sizes in bytes, without prefixes - **-B**, **--bytes**: list file sizes in bytes, without any prefixes
- **-g**, **--group**: show group as well as user - **-g**, **--group**: list each file's group
- **-h**, **--header**: show a header row - **-h**, **--header**: add a header row to each column
- **-H**, **--links**: show number of hard links column - **-H**, **--links**: list each file's number of hard links
- **-i**, **--inode**: show inode number column - **-i**, **--inode**: list each file's inode number
- **-m**, **--modified**: display timestamp of most recent modification - **-m**, **--modified**: use the modified timestamp field
- **-S**, **--blocks**: show number of file system blocks - **-S**, **--blocks**: list each file's number of file system blocks
- **-t**, **--time=(field)**: which timestamp to show for a file - **-t**, **--time=(field)**: which timestamp field to use
- **-u**, **--accessed**: display timestamp of last access for a file - **-u**, **--accessed**: use the accessed timestamp field
- **-U**, **--created**: display timestamp of creation of a file - **-U**, **--created**: use the created timestamp field
- **-@**, **--extended**: display extended attribute keys and sizes - **-@**, **--extended**: list each file's extended attributes and sizes
- **--git**: show Git status for a file - **--git**: list each file's Git status, if tracked
Accepted **--color** options are **always**, **automatic**, and **never**. - Valid **--color** options are **always**, **automatic**, and **never**.
Valid sort fields are **name**, **size**, **extension**, **modified**, **accessed**, **created**, **inode**, and **none**. - Valid sort fields are **accessed**, **created**, **extension**, **Extension**, **inode**, **modified**, **name**, **Name**, **size**, and **none**. Fields starting with a capital letter are case-sensitive.
Valid time fields are **modified**, **accessed**, and **created**. - Valid time fields are **modified**, **accessed**, and **created**.
## Installation ## Installation

View File

@ -4,11 +4,11 @@ complete -c exa -s '?' -l 'help' -d "Show list of command-line options"
# Display options # Display options
complete -c exa -s '1' -l 'oneline' -d "Display one entry per line" complete -c exa -s '1' -l 'oneline' -d "Display one entry per line"
complete -c exa -s 'l' -l 'long' -d "Display extended file metadata as a table"
complete -c exa -s 'G' -l 'grid' -d "Display entries in a grid" complete -c exa -s 'G' -l 'grid' -d "Display entries in a grid"
complete -c exa -s 'l' -l 'long' -d "Display extended details and attributes" complete -c exa -s 'x' -l 'across' -d "Sort the grid across, rather than downwards"
complete -c exa -s 'R' -l 'recurse' -d "Recurse into directories" complete -c exa -s 'R' -l 'recurse' -d "Recurse into directories"
complete -c exa -s 'T' -l 'tree' -d "Recurse into directories as a tree" complete -c exa -s 'T' -l 'tree' -d "Recurse into directories as a tree"
complete -c exa -s 'x' -l 'across' -d "Sort multi-column view entries accross"
complete -c exa -s 'F' -l 'classify' -d "Display type indicator by file names" complete -c exa -s 'F' -l 'classify' -d "Display type indicator by file names"
complete -c exa -l 'color' -d "When to use terminal colours" complete -c exa -l 'color' -d "When to use terminal colours"
complete -c exa -l 'colour' -d "When to use terminal colours" complete -c exa -l 'colour' -d "When to use terminal colours"
@ -19,6 +19,7 @@ complete -c exa -l 'colour-scale' -d "Highlight levels of file sizes dist
complete -c exa -l 'group-directories-first' -d "Sort directories before other files" complete -c exa -l 'group-directories-first' -d "Sort directories before other files"
complete -c exa -s 'a' -l 'all' -d "Don't hide hidden and 'dot' files" complete -c exa -s 'a' -l 'all' -d "Don't hide hidden and 'dot' files"
complete -c exa -s 'd' -l 'list-dirs' -d "List directories like regular files" complete -c exa -s 'd' -l 'list-dirs' -d "List directories like regular files"
complete -c exa -s 'L' -l 'level' -d "Limit the depth of recursion" -a "1 2 3 4 5 6 7 8 9"
complete -c exa -s 'r' -l 'reverse' -d "Reverse the sort order" complete -c exa -s 'r' -l 'reverse' -d "Reverse the sort order"
complete -c exa -s 's' -l 'sort' -x -d "Which field to sort by" -a " complete -c exa -s 's' -l 'sort' -x -d "Which field to sort by" -a "
accessed\t'Sort by file accessed time' accessed\t'Sort by file accessed time'
@ -40,16 +41,15 @@ complete -c exa -s 's' -l 'sort' -x -d "Which field to sort by" -a "
complete -c exa -s 'I' -l 'ignore-glob' -d "Ignore files that match these glob patterns" -r complete -c exa -s 'I' -l 'ignore-glob' -d "Ignore files that match these glob patterns" -r
# Long view options # Long view options
complete -c exa -s 'b' -l 'binary' -d "Display file sizes with binary prefixes" complete -c exa -s 'b' -l 'binary' -d "List file sizes with binary prefixes"
complete -c exa -s 'B' -l 'bytes' -d "Display file sizes in bytes, without any prefixes" complete -c exa -s 'B' -l 'bytes' -d "List file sizes in bytes, without any prefixes"
complete -c exa -s 'g' -l 'group' -d "Show each file's group" complete -c exa -s 'g' -l 'group' -d "List each file's group"
complete -c exa -s 'h' -l 'header' -d "Add a header row to each column" complete -c exa -s 'h' -l 'header' -d "Add a header row to each column"
complete -c exa -s 'h' -l 'links' -d "Show each file's number of hard links" complete -c exa -s 'h' -l 'links' -d "List each file's number of hard links"
complete -c exa -s 'g' -l 'group' -d "Show each file's inode number" complete -c exa -s 'g' -l 'group' -d "List each file's inode number"
complete -c exa -s 'L' -l 'level' -d "Limit the depth of recursion" -a "1 2 3 4 5 6 7 8 9"
complete -c exa -s 'm' -l 'modified' -d "Use the modified timestamp field" complete -c exa -s 'm' -l 'modified' -d "Use the modified timestamp field"
complete -c exa -s 'S' -l 'blocks' -d "Show each file's number of filesystem blocks" complete -c exa -s 'S' -l 'blocks' -d "List each file's number of filesystem blocks"
complete -c exa -s 't' -l 'time' -x -d "Which time field to show" -a " complete -c exa -s 't' -l 'time' -x -d "Which timestamp field to list" -a "
accessed\t'Display accessed time' accessed\t'Display accessed time'
created\t'Display created time' created\t'Display created time'
modified\t'Display modified time' modified\t'Display modified time'
@ -58,5 +58,5 @@ complete -c exa -s 'u' -l 'accessed' -d "Use the accessed timestamp field"
complete -c exa -s 'U' -l 'created' -d "Use the created timestamp field" complete -c exa -s 'U' -l 'created' -d "Use the created timestamp field"
# Optional extras # Optional extras
complete -c exa -s 'g' -l 'git' -d "Show the group column" complete -c exa -s 'g' -l 'git' -d "List each file's Git status, if tracked"
complete -c exa -s '@' -l 'extended' -d "Show each file's extended attributes and sizes" complete -c exa -s '@' -l 'extended' -d "List each file's extended attributes and sizes"

View File

@ -5,8 +5,9 @@ __exa() {
"(- 1 *)"{-v,--version}"[Show version of exa]" \ "(- 1 *)"{-v,--version}"[Show version of exa]" \
"(- 1 *)"{-\?,--help}"[Show list of command-line options]" \ "(- 1 *)"{-\?,--help}"[Show list of command-line options]" \
{-1,--oneline}"[Display one entry per line]" \ {-1,--oneline}"[Display one entry per line]" \
{-l,--long}"[Display extended file metadata as a table]" \
{-G,--grid}"[Display entries as a grid]" \ {-G,--grid}"[Display entries as a grid]" \
{-l,--long}"[Display extended metadata as a table]" \ {-x,--across}"[Sort the grid across, rather than downwards]" \
{-R,--recurse}"[Recurse into directories]" \ {-R,--recurse}"[Recurse into directories]" \
{-T,--tree}"[Recurse into directories as a tree]" \ {-T,--tree}"[Recurse into directories as a tree]" \
{-F,--classify}"[Display type indicator by file names]" \ {-F,--classify}"[Display type indicator by file names]" \
@ -15,23 +16,23 @@ __exa() {
--group-directories-first"[Sort directories before other files]" \ --group-directories-first"[Sort directories before other files]" \
{-a,--all}"[Don't hide hidden and 'dot' files]" \ {-a,--all}"[Don't hide hidden and 'dot' files]" \
{-d,--list-dirs}"[List directories like regular files]" \ {-d,--list-dirs}"[List directories like regular files]" \
{-L,--level}"+[Limit the depth of recursion]" \
{-r,--reverse}"[Reverse the sort order]" \ {-r,--reverse}"[Reverse the sort order]" \
{-s,--sort}"[Which field to sort by]:(sort field):(accessed created extension Extension filename Filename inode modified name Name none size)" \ {-s,--sort}"[Which field to sort by]:(sort field):(accessed created extension Extension filename Filename inode modified name Name none size)" \
{-I,--ignore-glob}"[Ignore files that match these glob patterns]" \ {-I,--ignore-glob}"[Ignore files that match these glob patterns]" \
{-b,--binary}"[Display file sizes with binary prefixes]" \ {-b,--binary}"[List file sizes with binary prefixes]" \
{-B,--bytes}"[Display file sizes in bytes, without any prefixes]" \ {-B,--bytes}"[List file sizes in bytes, without any prefixes]" \
{-g,--group}"[Show each file's group]" \ {-g,--group}"[List each file's group]" \
{-h,--header}"[Add a header row to each column]" \ {-h,--header}"[Add a header row to each column]" \
{-H,--links}"[Show each file's number of hard links]" \ {-H,--links}"[List each file's number of hard links]" \
{-i,--inode}"[Show each file's inode number]" \ {-i,--inode}"[List each file's inode number]" \
{-L,--level}"+[Limit the depth of recursion]" \
{-m,--modified}"[Use the modified timestamp field]" \ {-m,--modified}"[Use the modified timestamp field]" \
{-S,--blocks}"[Show each file's number of filesystem blocks]" \ {-S,--blocks}"[List each file's number of filesystem blocks]" \
{-t,--time}"[Which time field to show]:(time field):(accessed created modified)" \ {-t,--time}"[Which time field to show]:(time field):(accessed created modified)" \
{-u,--accessed}"[Use the accessed timestamp field]" \ {-u,--accessed}"[Use the accessed timestamp field]" \
{-U,--created}"[Use the created timestamp field]" \ {-U,--created}"[Use the created timestamp field]" \
{-U,--created}"[Show each file's Git status, if tracked]" \ --git"[List each file's Git status, if tracked]" \
{-@,--extended}"[Show each file's extended attributes and sizes]" \ {-@,--extended}"[List each file's extended attributes and sizes]" \
'*:filename:_files' '*:filename:_files'
} }

View File

@ -1,5 +1,5 @@
.hy .hy
.TH "exa" "1" "2015\-10\-18" "exa 0.4.0" "" .TH "exa" "1" "2017\-05\-06" "exa 0.5.0" ""
.SH NAME .SH NAME
.PP .PP
exa \- a modern replacement for ls exa \- a modern replacement for ls
@ -23,12 +23,17 @@ display one entry per line
.RE .RE
.TP .TP
.B \-G, \-\-grid .B \-G, \-\-grid
display entries in a grid view (default) display entries as a grid (default)
.RS .RS
.RE .RE
.TP .TP
.B \-l, \-\-long .B \-l, \-\-long
display extended details and attributes display extended file metadata as a table
.RS
.RE
.TP
.B \-x, \-\-across
sort the grid across, rather than downwards
.RS .RS
.RE .RE
.TP .TP
@ -38,39 +43,45 @@ recurse into directories
.RE .RE
.TP .TP
.B \-T, \-\-tree .B \-T, \-\-tree
recurse into subdirectories in a tree view recurse into directories as a tree
.RS
.RE
.TP
.B \-x, \-\-across
sort multi\-column view entries across
.RS .RS
.RE .RE
.TP .TP
.B \-\-color, \-\-colour=\f[I]WHEN\f[] .B \-\-color, \-\-colour=\f[I]WHEN\f[]
when to colourise the output (always, automatic, never) when to use terminal colours (always, automatic, never)
.RS
.RE
.TP
.B \-\-color-scale, \-\-colour-scale
highlight levels of file sizes distinctly
.RS .RS
.RE .RE
.SH FILTERING AND SORTING OPTIONS .SH FILTERING AND SORTING OPTIONS
.TP .TP
.B \-a, \-\-all .B \-a, \-\-all
show dot\-files don\[aq]t hide hidden and \[aq]dot\[aq] files
.RS .RS
.RE .RE
.TP .TP
.B \-d, \-\-list\-dirs .B \-d, \-\-list\-dirs
list directories as regular files list directories like regular files
.RS .RS
.RE .RE
.TP .TP
.B \-r, \-\-reverse .B \-r, \-\-reverse
reverse order of files reverse the sort order
.RS .RS
.RE .RE
.TP .TP
.B \-s, \-\-sort=\f[I]WORD\f[] .B \-s, \-\-sort=\f[I]SORT_FIELD\f[]
field to sort by (name, size, extension, modified, accessed, created, which field to sort by.
inode, none) Valid fields are name, Name, extension, Extension, size, modified, accessed, created, inode, and none.
Fields starting with a capital letter are case-sensitive.
.RS
.RE
.TP
.B \-I, \-\-ignore\-glob=\f[I]GLOBS\f[]
Glob patterns, pipe-separated, of files to ignore
.RS .RS
.RE .RE
.TP .TP
@ -84,72 +95,72 @@ These options are available when running with \f[C]\-\-long\f[]
(\f[C]\-l\f[]): (\f[C]\-l\f[]):
.TP .TP
.B \-b, \-\-binary .B \-b, \-\-binary
use binary prefixes in file sizes list file sizes with binary prefixes
.RS .RS
.RE .RE
.TP .TP
.B \-B, \-\-bytes .B \-B, \-\-bytes
list file sizes in bytes, without prefixes list file sizes in bytes, without any prefixes
.RS .RS
.RE .RE
.TP .TP
.B \-g, \-\-group .B \-g, \-\-group
show group as well as user list each file\[aq]s group
.RS .RS
.RE .RE
.TP .TP
.B \-h, \-\-header .B \-h, \-\-header
show a header row at the top add a header row to each column
.RS .RS
.RE .RE
.TP .TP
.B \-H, \-\-links .B \-H, \-\-links
show number of hard links list each file\[aq]s number of hard links
.RS .RS
.RE .RE
.TP .TP
.B \-i, \-\-inode .B \-i, \-\-inode
show each file\[aq]s inode number list each file\[aq]s inode number
.RS .RS
.RE .RE
.TP .TP
.B \-L, \-\-level=\f[I]DEPTH\f[] .B \-L, \-\-level=\f[I]DEPTH\f[]
maximum depth of recursion limit the depth of recursion
.RS .RS
.RE .RE
.TP .TP
.B \-m, \-\-modified .B \-m, \-\-modified
display timestamp of most recent modification use the modified timestamp field
.RS .RS
.RE .RE
.TP .TP
.B \-S, \-\-blocks .B \-S, \-\-blocks
show number of file system blocks list each file\[aq]s number of file system blocks
.RS .RS
.RE .RE
.TP .TP
.B \-t, \-\-time=\f[I]WORD\f[] .B \-t, \-\-time=\f[I]WORD\f[]
which timestamp to show for a file (modified, accessed, created) which timestamp field to list (modified, accessed, created)
.RS .RS
.RE .RE
.TP .TP
.B \-u, \-\-accessed .B \-u, \-\-accessed
display timestamp of last access for a file use the accessed timestamp field
.RS .RS
.RE .RE
.TP .TP
.B \-U, \-\-created .B \-U, \-\-created
display timestamp of creation for a file use the created timestamp field
.RS .RS
.RE .RE
.TP .TP
.B \-\@, \-\-extended .B \-\@, \-\-extended
display extended attribute keys and sizes list each file\[aq]s extended attributes and sizes
.RS .RS
.RE .RE
.TP .TP
.B \-\-git .B \-\-git
display Git status for a file, if available list each file\[aq]s Git status, if tracked
.RS .RS
.RE .RE
.SH EXAMPLES .SH EXAMPLES

View File

@ -1,44 +1,46 @@
pub static OPTIONS: &'static str = r##" pub static OPTIONS: &'static str = r##"
-?, --help show list of command-line options
-v, --version show version of exa
DISPLAY OPTIONS DISPLAY OPTIONS
-1, --oneline display one entry per line -1, --oneline display one entry per line
-G, --grid display entries in a grid view (default) -l, --long display extended file metadata as a table
-l, --long display extended details and attributes -G, --grid display entries as a grid (default)
-x, --across sort the grid across, rather than downwards
-R, --recurse recurse into directories -R, --recurse recurse into directories
-T, --tree recurse into subdirectories in a tree view -T, --tree recurse into directories as a tree
-x, --across sort multi-column view entries across -F, --classify display type indicator by file names
-F, --classify show file type indicator (one of */=@|) --colo[u]r=WHEN when to use terminal colours (always, auto, never)
--colo[u]r-scale highlight levels of file sizes distinctly
--color=WHEN, --colour=WHEN when to colourise the output (always, auto, never)
--color-scale, --colour-scale colour file sizes according to their magnitude
FILTERING AND SORTING OPTIONS FILTERING AND SORTING OPTIONS
-a, --all show dot-files -a, --all don't hide hidden and 'dot' files
-d, --list-dirs list directories as regular files -d, --list-dirs list directories like regular files
-r, --reverse reverse order of files -r, --reverse reverse the sort order
-s, --sort SORT_FIELD field to sort by. Choices: name, -s, --sort SORT_FIELD which field to sort by:
size, extension, modified,
accessed, created, inode, none
--group-directories-first list directories before other files --group-directories-first list directories before other files
-I, --ignore-glob GLOBS glob patterns (pipe-separated) of files to ignore -I, --ignore-glob GLOBS glob patterns (pipe-separated) of files to ignore
Valid sort fields: name, Name, extension, Extension, size,
modified, accessed, created, inode, none
"##; "##;
pub static LONG_OPTIONS: &'static str = r##" pub static LONG_OPTIONS: &'static str = r##"
LONG VIEW OPTIONS LONG VIEW OPTIONS
-b, --binary use binary prefixes in file sizes -b, --binary list file sizes with binary prefixes
-B, --bytes list file sizes in bytes, without prefixes -B, --bytes list file sizes in bytes, without any prefixes
-g, --group show group as well as user -g, --group list each file's group
-h, --header show a header row at the top -h, --header add a header row to each column
-H, --links show number of hard links -H, --links list each file's number of hard links
-i, --inode show each file's inode number -i, --inode list each file's inode number
-L, --level DEPTH maximum depth of recursion -L, --level DEPTH limit the depth of recursion
-m, --modified display timestamp of most recent modification -m, --modified use the modified timestamp field
-S, --blocks show number of file system blocks -S, --blocks show number of file system blocks
-t, --time FIELD which timestamp to show for a file. Choices: -t, --time FIELD which timestamp field to list (modified, accessed, created)
modified, accessed, created -u, --accessed use the accessed timestamp field
-u, --accessed display timestamp of last access for a file -U, --created use the created timestamp field
-U, --created display timestamp of creation for a file
"##; "##;
pub static GIT_HELP: &'static str = r##" --git show git status for files"##; pub static GIT_HELP: &'static str = r##" --git list each file's Git status, if tracked"##;
pub static EXTENDED_HELP: &'static str = r##" -@, --extended display extended attribute keys and sizes"##; pub static EXTENDED_HELP: &'static str = r##" -@, --extended list each file's extended attributes and sizes"##;

View File

@ -45,50 +45,50 @@ impl Options {
where S: AsRef<OsStr> { where S: AsRef<OsStr> {
let mut opts = getopts::Options::new(); let mut opts = getopts::Options::new();
opts.optflag("v", "version", "display version of exa"); opts.optflag("v", "version", "show version of exa");
opts.optflag("?", "help", "show list of command-line options"); opts.optflag("?", "help", "show list of command-line options");
// Display options // Display options
opts.optflag("1", "oneline", "display one entry per line"); opts.optflag("1", "oneline", "display one entry per line");
opts.optflag("G", "grid", "display entries in a grid view (default)"); opts.optflag("l", "long", "display extended file metadata in a table");
opts.optflag("l", "long", "display extended details and attributes"); opts.optflag("G", "grid", "display entries as a grid (default)");
opts.optflag("x", "across", "sort the grid across, rather than downwards");
opts.optflag("R", "recurse", "recurse into directories"); opts.optflag("R", "recurse", "recurse into directories");
opts.optflag("T", "tree", "recurse into subdirectories in a tree view"); opts.optflag("T", "tree", "recurse into directories as a tree");
opts.optflag("x", "across", "sort multi-column view entries across"); opts.optflag("F", "classify", "display type indicator by file names (one of */=@|)");
opts.optflag("F", "classify", "show file type indicator (one of */=@|)"); opts.optopt ("", "color", "when to use terminal colours", "WHEN");
opts.optopt ("", "color", "when to show anything in colours", "WHEN"); opts.optopt ("", "colour", "when to use terminal colours", "WHEN");
opts.optopt ("", "colour", "when to show anything in colours (alternate spelling)", "WHEN"); opts.optflag("", "color-scale", "highlight levels of file sizes distinctly");
opts.optflag("", "color-scale", "use a colour scale when displaying file sizes (alternate spelling)"); opts.optflag("", "colour-scale", "highlight levels of file sizes distinctly");
opts.optflag("", "colour-scale", "use a colour scale when displaying file sizes");
// Filtering and sorting options // Filtering and sorting options
opts.optflag("", "group-directories-first", "list directories before other files"); opts.optflag("", "group-directories-first", "sort directories before other files");
opts.optflag("a", "all", "show dot-files"); opts.optflag("a", "all", "don't hide hidden and 'dot' files");
opts.optflag("d", "list-dirs", "list directories as regular files"); opts.optflag("d", "list-dirs", "list directories like regular files");
opts.optflag("r", "reverse", "reverse order of files"); opts.optopt ("L", "level", "limit the depth of recursion", "DEPTH");
opts.optopt ("s", "sort", "field to sort by", "WORD"); opts.optflag("r", "reverse", "reverse the sert order");
opts.optopt ("I", "ignore-glob", "patterns (|-separated) of names to ignore", "GLOBS"); opts.optopt ("s", "sort", "which field to sort by", "WORD");
opts.optopt ("I", "ignore-glob", "ignore files that match these glob patterns", "GLOB1|GLOB2...");
// Long view options // Long view options
opts.optflag("b", "binary", "use binary prefixes in file sizes"); opts.optflag("b", "binary", "list file sizes with binary prefixes");
opts.optflag("B", "bytes", "list file sizes in bytes, without prefixes"); opts.optflag("B", "bytes", "list file sizes in bytes, without prefixes");
opts.optflag("g", "group", "show group as well as user"); opts.optflag("g", "group", "list each file's group");
opts.optflag("h", "header", "show a header row at the top"); opts.optflag("h", "header", "add a header row to each column");
opts.optflag("H", "links", "show number of hard links"); opts.optflag("H", "links", "list each file's number of hard links");
opts.optflag("i", "inode", "show each file's inode number"); opts.optflag("i", "inode", "list each file's inode number");
opts.optopt ("L", "level", "maximum depth of recursion", "DEPTH"); opts.optflag("m", "modified", "use the modified timestamp field");
opts.optflag("m", "modified", "display timestamp of most recent modification"); opts.optflag("S", "blocks", "list each file's number of file system blocks");
opts.optflag("S", "blocks", "show number of file system blocks"); opts.optopt ("t", "time", "which timestamp field to show", "WORD");
opts.optopt ("t", "time", "which timestamp to show for a file", "WORD"); opts.optflag("u", "accessed", "use the accessed timestamp field");
opts.optflag("u", "accessed", "display timestamp of last access for a file"); opts.optflag("U", "created", "use the created timestamp field");
opts.optflag("U", "created", "display timestamp of creation for a file");
if cfg!(feature="git") { if cfg!(feature="git") {
opts.optflag("", "git", "show git status"); opts.optflag("", "git", "list each file's git status");
} }
if xattr::ENABLED { if xattr::ENABLED {
opts.optflag("@", "extended", "display extended attribute keys and sizes"); opts.optflag("@", "extended", "list each file's extended attribute keys and sizes");
} }
let matches = match opts.parse(args) { let matches = match opts.parse(args) {