From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18212 invoked by alias); 9 Apr 2012 14:37:34 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16999 Received: (qmail 6638 invoked from network); 9 Apr 2012 14:37:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.213.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hlZYqctmYlgMjJ4u6xc7/iI08csxCLJGYLyJWPbO6Ek=; b=r7mzqWR3hZhitBcJCTxuHFB7kfZDVatMfpq/yLkAIR4B8Rf/hC46l117xJhsKcqqLh +NCbWuGoqUREzYAEvwn8Mj7unkKPlgOCvlo0HkjteaJRyRvDhRG2/V3IpMcvMCJpoS2a lQspxlMabqmgIsClMRxqa8onDPZh9rI4zVyo5YinRkVUwF0lO4UV7+OAoGuxayORcQ4J vpg89uRAHItZB6lAwKlvUmObL2uSAtub2zYrahIkaYCPB5FLLOVb87kJ5GhiMdO/q/JY NVRXHzW0/QC7v6ZdTnozKj7RVImkaJOeS+23wHXRibbwpdfVviPIs8MaeqJYV1z0njpE TvAg== MIME-Version: 1.0 Date: Mon, 9 Apr 2012 14:12:50 +0000 Message-ID: Subject: zsh[modules]/zutil: zparseopts should parse alternate long options From: toki clover To: zsh-users@zsh.org Content-Type: text/plain; charset=ISO-8859-1 Hi, zsh/zutil is handy to get a nice parse option utilities and, in fact, I use it often in scripts which permit to limit dozen of lines to just parse options with getopt from GNU util-linux package. And once one get used to it, one do not want to write again and again that long: while [[ $# >0 ]]; do case $1 in -o|--option) some_variable_asignement; shift;; ... esac done case assignement. Now, it would be nice if an alternate long option e.g. `-option' instead of the GNU style `--option' would work, because in the present day, if the first letter of a long option name is a short option name, the long option would never be parsed as one would expect. So one should use extra `-' hyphens to get his/her long option parsed, so to speak, to use a la GNU style long option way. Thanks.