From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15558 invoked from network); 31 Aug 2008 03:17:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Aug 2008 03:17:04 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 91095 invoked from network); 31 Aug 2008 03:16:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Aug 2008 03:16:57 -0000 Received: (qmail 5396 invoked by alias); 31 Aug 2008 03:16:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25563 Received: (qmail 5367 invoked from network); 31 Aug 2008 03:16:40 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 31 Aug 2008 03:16:40 -0000 Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by bifrost.dotsrc.org (Postfix) with ESMTPS id BD549801E2B4 for ; Sun, 31 Aug 2008 05:16:36 +0200 (CEST) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.3/8.14.3) with ESMTP id m7V3GXFI092706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 30 Aug 2008 22:16:33 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.3/8.14.2/Submit) id m7V3GWNj092705; Sat, 30 Aug 2008 22:16:32 -0500 (CDT) (envelope-from dan) Date: Sat, 30 Aug 2008 22:16:32 -0500 From: Dan Nelson To: Rocky Bernstein Cc: Zsh hackers list Subject: Re: Numeric version of ZSH_VERSION? Message-ID: <20080831031632.GI26653@dan.emsphone.com> References: <6cd6de210808301954x6fd72987i4bb0ea3665951de1@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6cd6de210808301954x6fd72987i4bb0ea3665951de1@mail.gmail.com> X-OS: FreeBSD 7.0-STABLE User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8122/Sun Aug 31 03:04:56 2008 on bifrost X-Virus-Status: Clean 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