date and uniq completions for OS X.

This commit is contained in:
lordlycastle 2016-03-10 15:35:39 +00:00 committed by Fabian Homborg
parent 6288f89bf9
commit 540bdfcb02
2 changed files with 45 additions and 26 deletions

View file

@ -1,11 +1,22 @@
complete -c date -s d -l date --description "Display date described by string" -x
complete -c date -s f -l file --description "Display date for each line in file" -r
complete -c date -s I -l iso-8601 --description "Output in ISO 8601 format" -x -a "date hours minutes seconds"
complete -c date -s s -l set --description "Set time" -x
complete -c date -s R -l rfc-2822 --description "Output RFC-2822 compliant date string"
complete -c date -s r -l reference --description "Display the last modification time of file" -r
complete -c date -s u -l utc --description "Print or set Coordinated Universal Time"
complete -c date -l universal --description "Print or set Coordinated Universal Time"
complete -c date -s h -l help --description "Display help and exit"
complete -c date -s v -l version --description "Display version and exit"
if date --version > /dev/null ^ /dev/null
complete -c date -s d -l date --description "Display date described by string" -x
complete -c date -s f -l file --description "Display date for each line in file" -r
complete -c date -s I -l iso-8601 --description "Output in ISO 8601 format" -x -a "date hours minutes seconds"
complete -c date -s s -l set --description "Set time" -x
complete -c date -s R -l rfc-2822 --description "Output RFC-2822 compliant date string"
complete -c date -s r -l reference --description "Display the last modification time of file" -r
complete -c date -s u -l utc --description "Print or set Coordinated Universal Time"
complete -c date -l universal --description "Print or set Coordinated Universal Time"
complete -c date -s h -l help --description "Display help and exit"
complete -c date -s v -l version --description "Display version and exit"
else # OS X
complete -c date -s d -d 'Set the kernel\'s value for daylight saving time' -x
complete -c date -s f -d 'Use format string to parse the date provided rather than default format'
complete -c date -s j -d 'Do no try to set the date'
complete -c date -s n -d 'Set the time for current machine only in the local group'
complete -c date -s r -d 'Print date and time represented by SEC since Epoch' -x
complete -c date -s t -d 'Set system\'s value for MINUTES west of GMT'
complete -c date -s u -d 'Display or set the date int UTC time'
complete -c date -s v -d 'Adjust the time component backward(-)/forward(+) according to VAL' -x
end

View file

@ -1,15 +1,23 @@
complete -c uniq -s c -l count --description "Print number of occurences"
complete -c uniq -s d -l repeated --description "Only print duplicates"
complete -c uniq -s D -l all-repeated --description "Remove non-duplicate lines" -f -x -a "
none\t'Remove none-duplicate lines'
prepend\t'Remove non-duplicate lines and print an empty line before each non-duplicate'
separate\t'Remove non-duplicate lines and print an empty line between each non-duplicate'
"
complete -c uniq -s f -l skip-fields --description "Avoid comparing first N fields" -r
complete -c uniq -s i -l ignore-case --description "Case insensitive"
complete -c uniq -s s -l skip-chars --description "Avoid comparing first N characters" -r
complete -c uniq -s u -l unique --description "Only print unique lines"
complete -c uniq -s w -l check-chars --description "Compare only specified number of characters" -r
complete -c uniq -l help --description "Display help and exit"
complete -c uniq -l version --description "Display version and exit"
if uniq --version > /dev/null ^ /dev/null
complete -c uniq -s c -l count --description "Print number of occurences"
complete -c uniq -s d -l repeated --description "Only print duplicates"
complete -c uniq -s D -l all-repeated --description "Remove non-duplicate lines" -f -x -a "
none\t'Remove none-duplicate lines'
prepend\t'Remove non-duplicate lines and print an empty line before each non-duplicate'
separate\t'Remove non-duplicate lines and print an empty line between each non-duplicate'
"
complete -c uniq -s f -l skip-fields --description "Avoid comparing first N fields" -r
complete -c uniq -s i -l ignore-case --description "Case insensitive"
complete -c uniq -s s -l skip-chars --description "Avoid comparing first N characters" -r
complete -c uniq -s u -l unique --description "Only print unique lines"
complete -c uniq -s w -l check-chars --description "Compare only specified number of characters" -r
complete -c uniq -l help --description "Display help and exit"
complete -c uniq -l version --description "Display version and exit"
else # OS X
complete -c uniq -s c -d 'Precede each output line with count of it\'s occurrence'
complete -c uniq -s d -d 'Only print duplicates'
complete -c uniq -s f -d 'Avoid comparing first N fields' -x
complete -c uniq -s s -d 'Avoid comparing fist N characters' -x
complete -c uniq -s u -d 'Only print unique lines'
complete -c uniq -s i -d 'Case insensitive comparision'
end