From: "Rocky Bernstein" <rocky.bernstein@gmail.com>
To: "Dan Nelson" <dnelson@allantgroup.com>
Cc: "Zsh hackers list" <zsh-workers@sunsite.dk>
Subject: Re: Numeric version of ZSH_VERSION?
Date: Sun, 31 Aug 2008 09:21:10 -0400 [thread overview]
Message-ID: <6cd6de210808310621j6faa90d9yfc3c5d21b0b70dca@mail.gmail.com> (raw)
In-Reply-To: <20080831031632.GI26653@dan.emsphone.com>
Ok - Great. I'll use this.
By the way the -z option listed as an option under autoload is not
documented there. However this is written:
Equivalent to "functions -u", with the exception of -X/+X and -w.
which is a bit compressed in meaning. I gather it means two different
things. First that it does the same thing as "functions -u" and
therefore second that it takes the same options as that, except those
mentioned. So third, you should look at "functions" to find out the
meaning of the unmentioned options.
Ok. So we then go to "functions" to try to figure out what "-z" does.
And along the way we've now picked up another option "-u" that we need
to understand. Both "-z" and "-u" are listed again but not documented
in "functions" either. However we get
Equivalent to "typeset -f" with the exception ...
Okay so now we have to chase down a 3rd reference and have picked up
yet a third option to now understand: "-f".
typeset has a grab bag of options that have nothing to do with either
"functions -u" or "autoload". In fact the "-u" means something
different when combined with "-f" than it does when that's not there.
On Sat, Aug 30, 2008 at 11:16 PM, Dan Nelson <dnelson@allantgroup.com> wrote:
> In the last episode (Aug 30), Rocky Bernstein said:
>> It'd be nice to have a numeric version of ZSH_VERSION which is just a
>> monotonically increasing number. It would make testing for features in
>> (possibly open-ended) ranges easy.
>
> The Misc/is-at-least function should do what you need:
>
> OTHER FUNCTIONS
> Descriptions
> is-at-least needed [ present ]
> Perform a greater-than-or-equal-to comparison of two strings
> having the format of a zsh version number; that is, a string of
> numbers and text with segments separated by dots or dashes. If
> the present string is not provided, $ZSH_VERSION is used. Seg-
> ments are paired left-to-right in the two strings with leading
> non-number parts ignored. If one string has fewer segments than
> the other, the missing segments are considered zero.
>
> This is useful in startup files to set options and other state
> that are not available in all versions of zsh.
>
> is-at-least 3.1.6-15 && setopt NO_GLOBAL_RCS
> is-at-least 3.1.0 && setopt HIST_REDUCE_BLANKS
> is-at-least 2.6-17 || print "You can't use is-at-least here."
>
>
> --
> Dan Nelson
> dnelson@allantgroup.com
>
next prev parent reply other threads:[~2008-08-31 13:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-31 2:54 Rocky Bernstein
2008-08-31 3:16 ` Dan Nelson
2008-08-31 13:21 ` Rocky Bernstein [this message]
2008-09-01 12:38 ` Richard Hartmann
2008-09-01 12:43 ` Mikael Magnusson
2008-09-01 13:06 ` Rocky Bernstein
2008-09-01 13:14 ` Rocky Bernstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6cd6de210808310621j6faa90d9yfc3c5d21b0b70dca@mail.gmail.com \
--to=rocky.bernstein@gmail.com \
--cc=dnelson@allantgroup.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).