diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2015-07-06 00:23:26 +0200 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2015-07-06 16:21:22 +0200 |
commit | 0b946c18eac9b1be3424ecaa037a837af59a920c (patch) | |
tree | 4371862e16e1f1b29838e7d9755949195ba101b9 /Completion/Unix/Type/_ps1234 | |
parent | b28ccc4270fd11bfd034218224793ebc0d39edf1 (diff) | |
download | zsh-0b946c18eac9b1be3424ecaa037a837af59a920c.tar.gz zsh-0b946c18eac9b1be3424ecaa037a837af59a920c.tar.xz zsh-0b946c18eac9b1be3424ecaa037a837af59a920c.zip |
35697: _ps1234, _date_formats: Complete strftime formats for %D{}
Diffstat (limited to 'Completion/Unix/Type/_ps1234')
-rw-r--r-- | Completion/Unix/Type/_ps1234 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Completion/Unix/Type/_ps1234 b/Completion/Unix/Type/_ps1234 index 866349fa9..b9e516628 100644 --- a/Completion/Unix/Type/_ps1234 +++ b/Completion/Unix/Type/_ps1234 @@ -7,7 +7,9 @@ if [[ -z $compstate[quote] ]]; then bs='\' fi -if [[ $PREFIX == *%(-|)<-># ]]; then +if [[ $PREFIX == *%D$bs\{[^($bs\})]# ]]; then + _date_formats zsh +elif [[ $PREFIX == *%(-|)<-># ]]; then specs=( 'm:hostname up to first .' '_:status of parser' @@ -52,7 +54,7 @@ if [[ $PREFIX == *%(-|)<-># ]]; then '*:current time of day, 24-hour format with seconds' 'w:the date in day-dd format' 'W:the date in mm/dd/yy format' - 'D{}:format string like strftime' + 'D{:format string like strftime' 'B:start bold' 'b:stop bold' 'E:clear to end of line' @@ -121,6 +123,12 @@ elif [[ $PREFIX == *%[FK]$bs\{[0-9a-z]# ]]; then _message -e ansi-color-number "number between 0 and $(( $terminfo[colors] - 1 ))" fi else - _describe -t prompt-format-specifier 'prompt format specifier' '(%)' -S '' _default "$@" + specs=(%) + if compset -P "*%D"; then + specs+=(\{) + else + compset -P "*" + fi + _describe -t prompt-format-specifier 'prompt format specifier' specs -S '' fi |