diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Doc/Zsh/options.yo | 10 | ||||
-rw-r--r-- | Functions/Calendar/age | 18 |
3 files changed, 24 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog index 6b0fac3a6..ba7792784 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-02-11 Peter Stephenson <pws@csr.com> + * Richard Hartmann: 26550: Doc/Zsh/options.yo: make + it clear that various options can't be changed within the shell. + * Frank Terbeck: 26549: Doc/Zsh/contrib.yo, Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr, Functions/VCS_Info/Backends/VCS_INFO_get_data_cdv, @@ -11148,5 +11151,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4560 $ +* $Revision: 1.4561 $ ***************************************************** diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 2cd02bf31..b5ce8139e 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -1837,7 +1837,8 @@ the standard input is a tty and commands are being read from standard input. (See the discussion of tt(SHIN_STDIN).) This heuristic may be overridden by specifying a state for this option on the command line. -The value of this option cannot be changed anywhere other than the command line. +The value of this option can only be changed with command line parameters. +It cannot be changed once zsh is running. ) pindex(LOGIN) pindex(NO_LOGIN) @@ -1891,8 +1892,8 @@ Note that setting or unsetting this option on the command line does not necessarily affect the state the option will have while the shell is running - that is purely an indicator of whether on not commands are em(actually) being read from standard input. -The value of this option cannot be changed anywhere other -than the command line. +The value of this option can only be changed with command line parameters. +It cannot be changed once zsh is running. ) pindex(SINGLE_COMMAND) pindex(NO_SINGLE_COMMAND) @@ -1904,7 +1905,8 @@ item(tt(SINGLE_COMMAND) (tt(-t), ksh: tt(-t)))( If the shell is reading from standard input, it exits after a single command has been executed. This also makes the shell non-interactive, unless the tt(INTERACTIVE) option is explicitly set on the command line. -The value of this option cannot be changed anywhere other than the command line. +The value of this option can only be changed with command line parameters. +It cannot be changed once zsh is running. ) enditem() diff --git a/Functions/Calendar/age b/Functions/Calendar/age index d47f975ad..160aae4a8 100644 --- a/Functions/Calendar/age +++ b/Functions/Calendar/age @@ -33,19 +33,29 @@ zmodload -i zsh/parameter autoload -U calendar_scandate -local -a vals +local -a vals tmp [[ -e $REPLY ]] || return 1 zstat -A vals +mtime $REPLY || return 1 if (( $# >= 1 )); then - local AGEREF=$1 + if [[ $1 = :* ]]; then + zstat -A tmp -F "%Y/%m/%d" +mtime ${1[2,-1]} || return 1 + local AGEREF=$tmp[1] + else + local AGEREF=$1 + fi # if 1 argument given, never use globally defined AGEREF2 - local AGEREF2=$2 + if [[ $2 = :* ]]; then + zstat -A tmp -F "%Y/%m/%d" +mtime ${2[2,-1]} || return 1 + local AGEREF2=$tmp[1] + else + local AGEREF2=$2 + fi fi integer mtime=$vals[1] date1 date2 -local REPLY +local REPLY REPLY2 # allow a time only (meaning today) if calendar_scandate -t $AGEREF; then |