mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
cat, mv, rm completions: shorten descriptions
This commit is contained in:
parent
c1859b5678
commit
3e8c05e32b
3 changed files with 43 additions and 46 deletions
|
@ -1,21 +1,21 @@
|
||||||
if cat --version 2>/dev/null > /dev/null # GNU
|
if cat --version 2>/dev/null > /dev/null # GNU
|
||||||
complete -c cat -s A -l show-all -d "Escape all non-printing characters"
|
complete -c cat -s A -l show-all -d "Escape all unprintables"
|
||||||
complete -c cat -s b -l number-nonblank -d "Number nonblank lines"
|
complete -c cat -s b -l number-nonblank -d "Number non-blank lines"
|
||||||
complete -c cat -s e -d "Escape non-printing characters except tab"
|
complete -c cat -s e -d "Escape unprintables except \\t"
|
||||||
complete -c cat -s E -l show-ends -d "Display \$ at end of line"
|
complete -c cat -s E -l show-ends -d "Display \$ at line end"
|
||||||
complete -c cat -s n -l number -d "Number all lines"
|
complete -c cat -s n -l number -d "Enumerate lines"
|
||||||
complete -c cat -s s -l squeeze-blank -d "Never more than single blank line"
|
complete -c cat -s s -l squeeze-blank -d "Never >1 blank line"
|
||||||
complete -c cat -s t -d "Escape non-printing characters except newline"
|
complete -c cat -s t -d "Escape unprintables except \\n"
|
||||||
complete -c cat -s T -l show-tabs -d "Escape tab"
|
complete -c cat -s T -l show-tabs -d "Escape tab"
|
||||||
complete -c cat -s v -d "Escape non-printing except newline and tab"
|
complete -c cat -s v -d "Escape unprintables except '\\n' and \\t"
|
||||||
complete -c cat -l help -d "Display help and exit"
|
complete -c cat -l help -d "Display help and exit"
|
||||||
complete -c cat -l version -d "Display version and exit"
|
complete -c cat -l version -d "Display version and exit"
|
||||||
else # OS X
|
else # OS X
|
||||||
complete -c cat -s b -d "Number non-blank lines"
|
complete -c cat -s b -d "Specify # of non-blank lines"
|
||||||
complete -c cat -s e -d "Display non-printing characters, and `\$' at the end of each line"
|
complete -c cat -s e -d "Show unprintables, end lines with \$"
|
||||||
complete -c cat -s n -d "Number all lines"
|
complete -c cat -s n -d "Enumerate lines"
|
||||||
complete -c cat -s s -d "Single spaced output by squeezing adjacent empty lines"
|
complete -c cat -s s -d "Squeeze away >1 blank lines"
|
||||||
complete -c cat -s t -d "Display non-printing characters, and tab characters as `^I'"
|
complete -c cat -s t -d "Show unprintables; tab as '^I'"
|
||||||
complete -c cat -s u -d "Disable output buffering"
|
complete -c cat -s u -d "Disable output buffering"
|
||||||
complete -c cat -s v -d "Display non-printing characters so they're visible."
|
complete -c cat -s v -d "Escape non-printing chars"
|
||||||
end
|
end
|
|
@ -13,21 +13,21 @@ if mv --version >/dev/null 2>/dev/null
|
||||||
simple\t'Make simple backups'
|
simple\t'Make simple backups'
|
||||||
never\t'Make simple backups'"
|
never\t'Make simple backups'"
|
||||||
complete -c mv -s b -d "Backup each existing destination file"
|
complete -c mv -s b -d "Backup each existing destination file"
|
||||||
complete -c mv -s f -l force -d "Don't prompt before overwriting"
|
complete -c mv -s f -l force -d "Don't prompt to overwrite"
|
||||||
complete -c mv -s i -l interactive -d "Prompt before overwriting"
|
complete -c mv -s i -l interactive -d "Prompt to overwrite"
|
||||||
complete -c mv -s n -l no-clobber -d "Don't overwrite existing files"
|
complete -c mv -s n -l no-clobber -d "Don't overwrite existing"
|
||||||
# --reply has been deprecated for over a decade, and now GNU mv does not accept this option.
|
# --reply has been deprecated for over a decade, and now GNU mv does not accept this option.
|
||||||
# Better to use -f instead of --reply=yes.
|
# Better to use -f instead of --reply=yes.
|
||||||
# complete -c mv -l reply -x -a "yes no query" -d "Answer for overwrite questions"
|
# complete -c mv -l reply -x -a "yes no query" -d "Answer for overwrite questions"
|
||||||
complete -c mv -l strip-trailing-slashes -d "Remove trailing slashes from source args"
|
complete -c mv -l strip-trailing-slashes -d "Remove trailing '/' from source args"
|
||||||
complete -c mv -s S -l suffix -x -d "Override default backup suffix"
|
complete -c mv -s S -l suffix -x -d "Override default backup suffix"
|
||||||
complete -c mv -s t -l target-directory -d "Move all source args into DIRECTORY" \
|
complete -c mv -s t -l target-directory -d "Move all source args into DIR" \
|
||||||
-x -a "(__fish_complete_directories (commandline -ct) 'DIRECTORY')"
|
-x -a "(__fish_complete_directories (commandline -ct) 'Directory')"
|
||||||
complete -c mv -s T -l no-target-directory -d "Treat DEST as a normal file"
|
complete -c mv -s T -l no-target-directory -d "Treat DEST as a normal file"
|
||||||
complete -c mv -s u -l update -d "Don't overwrite newer files"
|
complete -c mv -s u -l update -d "Don't overwrite newer"
|
||||||
complete -c mv -s v -l verbose -d "Print each file as it is moved"
|
complete -c mv -s v -l verbose -d "Print filenames as it goes"
|
||||||
test "$uname" = Linux
|
test "$uname" = Linux
|
||||||
and complete -c mv -s Z -l context -d "Sets SELinux context to default"
|
and complete -c mv -s Z -l context -d "Set SELinux context to default"
|
||||||
|
|
||||||
complete -c mv -l help -d "Print help and exit"
|
complete -c mv -l help -d "Print help and exit"
|
||||||
complete -c mv -l version -d "Print version and exit"
|
complete -c mv -l version -d "Print version and exit"
|
||||||
|
@ -41,22 +41,22 @@ else #[posix][ext]
|
||||||
# solaris: mv [-fi][ ] src dst
|
# solaris: mv [-fi][ ] src dst
|
||||||
|
|
||||||
# POSIX options
|
# POSIX options
|
||||||
complete -c mv -s f -d "Don't prompt before overwriting"
|
complete -c mv -s f -d "Don't prompt to overwrite"
|
||||||
complete -c mv -s i -d "Prompt before overwriting existing files"
|
complete -c mv -s i -d "Prompt to overwrite existing"
|
||||||
|
|
||||||
test uname = SunOS # -fi
|
test uname = SunOS # -fi
|
||||||
and exit 0
|
and exit 0
|
||||||
|
|
||||||
# Extensions
|
# Extensions
|
||||||
complete -c mv -s v -d "Print each file as it is moved"
|
complete -c mv -s v -d "Print filenames as it goes"
|
||||||
|
|
||||||
contains "$uname" NetBSD OpenBSD # -fiv
|
contains "$uname" NetBSD OpenBSD # -fiv
|
||||||
and exit 0
|
and exit 0
|
||||||
|
|
||||||
complete -c mv -s n -d "Don't overwrite existing files"
|
complete -c mv -s n -d "Don't overwrite existing"
|
||||||
|
|
||||||
test "$uname" = Darwin # -fivn
|
test "$uname" = Darwin # -fivn
|
||||||
and exit 0
|
and exit 0
|
||||||
|
|
||||||
complete -c mv -s h -d "If target is a link to a directory, don't follow it"
|
complete -c mv -s h -d "Don't follow target if it links to a dir"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#Completions for rm
|
#Completions for rm
|
||||||
if rm --version >/dev/null 2>/dev/null # GNU
|
if rm --version >/dev/null 2>/dev/null # GNU
|
||||||
complete -c rm -s d -l directory -d "Unlink directory (Only by superuser)"
|
complete -c rm -s d -l directory -d "Unlink directories"
|
||||||
complete -c rm -s f -l force -d "Never prompt before removal"
|
complete -c rm -s f -l force -d "Never prompt for removal"
|
||||||
complete -c rm -s i -l interactive -d "Prompt before removal"
|
complete -c rm -s i -l interactive -d "Prompt for removal"
|
||||||
complete -c rm -s I -d "Prompt before removing more than three files"
|
complete -c rm -s I -d "Prompt to remove >3 files"
|
||||||
complete -c rm -s r -l recursive -d "Recursively remove subdirectories"
|
complete -c rm -s r -l recursive -d "Recursively remove subdirs"
|
||||||
complete -c rm -s R -d "Recursively remove subdirectories"
|
complete -c rm -s R -d "Recursively remove subdirs"
|
||||||
complete -c rm -s v -l verbose -d "Explain what is done"
|
complete -c rm -s v -l verbose -d "Explain what is done"
|
||||||
complete -c rm -s h -l help -d "Display help and exit"
|
complete -c rm -s h -l help -d "Display help"
|
||||||
complete -c rm -l version -d "Display version and exit"
|
complete -c rm -l version -d "Display rm version"
|
||||||
else
|
else
|
||||||
set -l uname (uname -s)
|
set -l uname (uname -s)
|
||||||
# solaris: rm [-fi ] file ...
|
# solaris: rm [-fi ] file ...
|
||||||
|
@ -18,24 +18,21 @@ else
|
||||||
# freebsd: rm [-fidPRrvWxI] file ...
|
# freebsd: rm [-fidPRrvWxI] file ...
|
||||||
# dragonfly: rm [-fidPRrvWxI] file ...
|
# dragonfly: rm [-fidPRrvWxI] file ...
|
||||||
|
|
||||||
complete -c rm -s f -d "Never prompt before removal"
|
complete -c rm -s f -d "Never prompt for removal"
|
||||||
complete -c rm -s i -d "Prompt before removal"
|
complete -c rm -s i -d "Prompt for removal"
|
||||||
test "$uname" = SunOS
|
test "$uname" = SunOS
|
||||||
and exit 0
|
and exit 0
|
||||||
complete -c rm -s d -d "Attempt to remove directories as well"
|
complete -c rm -s d -d "Remove directories as well"
|
||||||
complete -c rm -s P -d "Overwrite before removal"
|
complete -c rm -s P -d "Overwrite before removal"
|
||||||
complete -c rm -s R -d "Recursively remove subdirectories"
|
complete -c rm -s R -s r -d "Recursively remove subdirs"
|
||||||
complete -c rm -s r -d "Recursively remove subdirectories"
|
|
||||||
complete -c rm -s v -d "Explain what is done"
|
complete -c rm -s v -d "Explain what is done"
|
||||||
test "$uname" = OpenBSD
|
test "$uname" = OpenBSD
|
||||||
and exit 0
|
and exit 0
|
||||||
complete -c rm -s W -d "Undelete the named files"
|
complete -c rm -s W -d "Undelete given filenames"
|
||||||
test "$uname" = Darwin
|
test "$uname" = Darwin
|
||||||
and exit 0
|
and exit 0
|
||||||
complete -c rm -s x -d "Do not traverse filesystem mount points"
|
complete -c rm -s x -d "Don't traverse mount points"
|
||||||
test "$uname" = NetBSD
|
test "$uname" = NetBSD
|
||||||
and exit 0
|
and exit 0
|
||||||
complete -c rm -s I -d "Like -i, but only if 3 or more files affected"
|
complete -c rm -s I -d "Prompt to remove >=3 files"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue