fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian Boehmcompletions: More shortened descriptionscbc66fe6e

master
2.8 KiB52 linesraw
1#
2# Completions for tr
3#
4
5# Test if we are using GNU tr
6if command tr --version >/dev/null 2>/dev/null
7    complete -c tr -x
8    complete -c tr -s c -s C -l complement -d 'use the complement of SET1'
9    complete -c tr -s d -l delete -d 'delete characters in SET1, do not translate'
10    complete -c tr -s s -l squeeze-repeats -d 'replace each run of a character listed in SET1 with a single occurrence of that character'
11    complete -c tr -s t -l truncate-set1 -d 'first truncate SET1 to length of SET2'
12    complete -c tr -l help -d 'display this help and exit'
13    complete -c tr -l version -d 'output version information and exit'
14
15    complete -c tr -a '[:alnum:]' -d 'all letters and digits'
16    complete -c tr -a '[:alpha:]' -d 'all letters'
17    complete -c tr -a '[:blank:]' -d 'all horizontal whitespace'
18    complete -c tr -a '[:cntrl:]' -d 'all control characters'
19    complete -c tr -a '[:digit:]' -d 'all digits'
20    complete -c tr -a '[:graph:]' -d 'all printable characters, not including space'
21    complete -c tr -a '[:lower:]' -d 'all lower case letters'
22    complete -c tr -a '[:print:]' -d 'all printable characters, including space'
23    complete -c tr -a '[:punct:]' -d 'all punctuation characters'
24    complete -c tr -a '[:space:]' -d 'all horizontal or vertical whitespace'
25    complete -c tr -a '[:upper:]' -d 'all upper case letters'
26    complete -c tr -a '[:xdigit:]' -d 'all hexadecimal digits'
27else
28    # If not a GNU system, assume we have standard BSD tr features instead
29    complete -c tr -x
30    complete -c tr -s C -d 'Complement the set of characters in string1'
31    complete -c tr -s c -d 'Same as -C but complement the set of values in string1'
32    complete -c tr -s d -d 'Delete characters in string1 from the input'
33    complete -c tr -s s -d 'Squeeze runs of characters listed in the last operand into one'
34    complete -c tr -l u -d 'Guarantee that any output is unbuffered.'
35
36    complete -c tr -a '[:alnum:]' -d 'alphanumeric characters'
37    complete -c tr -a '[:alpha:]' -d 'alphabetic characters'
38    complete -c tr -a '[:blank:]' -d 'whitespace characters'
39    complete -c tr -a '[:cntrl:]' -d 'control characters'
40    complete -c tr -a '[:digit:]' -d 'numeric characters'
41    complete -c tr -a '[:graph:]' -d 'graphic characters'
42    complete -c tr -a '[:ideogram:]' -d 'ideographic characters'
43    complete -c tr -a '[:lower:]' -d 'lower-case alphabetic characters'
44    complete -c tr -a '[:phonogram:]' -d 'phonographic characters'
45    complete -c tr -a '[:print:]' -d 'printable characters'
46    complete -c tr -a '[:punct:]' -d 'punctuation characters'
47    complete -c tr -a '[:rune:]' -d 'valid characters'
48    complete -c tr -a '[:space:]' -d 'space characters'
49    complete -c tr -a '[:special:]' -d 'special characters'
50    complete -c tr -a '[:upper:]' -d 'upper-case characters'
51    complete -c tr -a '[:xdigit:]' -d 'hexadecimal characters'
52end