2018-04-02 04:42:38 +08:00
|
|
|
if cat --version 2>/dev/null > /dev/null # GNU
|
2019-03-10 07:02:25 +08:00
|
|
|
complete -c cat -s A -l show-all -d "Escape all unprintables"
|
|
|
|
complete -c cat -s b -l number-nonblank -d "Number non-blank lines"
|
|
|
|
complete -c cat -s e -d "Escape unprintables except \\t"
|
|
|
|
complete -c cat -s E -l show-ends -d "Display \$ at line end"
|
|
|
|
complete -c cat -s n -l number -d "Enumerate lines"
|
|
|
|
complete -c cat -s s -l squeeze-blank -d "Never >1 blank line"
|
|
|
|
complete -c cat -s t -d "Escape unprintables except \\n"
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c cat -s T -l show-tabs -d "Escape tab"
|
2019-03-10 07:02:25 +08:00
|
|
|
complete -c cat -s v -d "Escape unprintables except '\\n' and \\t"
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c cat -l help -d "Display help and exit"
|
|
|
|
complete -c cat -l version -d "Display version and exit"
|
2015-11-28 08:35:26 +08:00
|
|
|
else # OS X
|
2019-03-10 07:02:25 +08:00
|
|
|
complete -c cat -s b -d "Specify # of non-blank lines"
|
|
|
|
complete -c cat -s e -d "Show unprintables, end lines with \$"
|
|
|
|
complete -c cat -s n -d "Enumerate lines"
|
|
|
|
complete -c cat -s s -d "Squeeze away >1 blank lines"
|
|
|
|
complete -c cat -s t -d "Show unprintables; tab as '^I'"
|
2015-11-28 08:35:26 +08:00
|
|
|
complete -c cat -s u -d "Disable output buffering"
|
2019-03-10 07:02:25 +08:00
|
|
|
complete -c cat -s v -d "Escape non-printing chars"
|
2015-11-28 08:35:26 +08:00
|
|
|
end
|