From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8815 invoked by alias); 13 Feb 2014 07:18:08 -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: 18436 Received: (qmail 13281 invoked from network); 13 Feb 2014 07:18:04 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.2 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=7qNAmPFj+iGJ9JiW2n+HXaV6I/dAbHPExo9NnjkuO7E=; b=OI8UP6DB9cAGMYOxVkVRbdp8DZlL0wP/OiP6PIteKYgYnwIQbtWK6taVEySM9Z/qiH J3vjbo9cRa4FG1Voulg1ALyL3tRKzKg84rojzG8ebTJtEyUvOKXSG799+IUhQgNII1/7 PrvzqESgE2BnztxUB8cUnG++I+I2I3kbX8/adWDsYsoTUCQkfHPiRVDjlNNigwqHQ87a Ch6fb9+H3m11Oy5S1Ub0sRB4tNFfVqNT8Yq1fr18FCPfNFzAtFpJD3KJ8RNGzvIooWON SSjJHayX/RMb3exNK+sv1HrM4F6xf3Vk8QeJ5VqjZyShitP7w0sTvw9rOZfJV6jlpwRx UV4w== MIME-Version: 1.0 X-Received: by 10.194.173.163 with SMTP id bl3mr40477wjc.73.1392275878811; Wed, 12 Feb 2014 23:17:58 -0800 (PST) Date: Thu, 13 Feb 2014 08:17:58 +0100 Message-ID: Subject: zparseopts default associative array From: Sebastian Stark To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Hi, if I have this script: typeset -A o o=(-a AAA -b BBB) zparseopts -K -A o a: b: print -- ${(kv)o[@]} and run it such: ./script.sh -a foo I would expect it to output "-a foo -b BBB". But the output is "-a foo". In the manual the -K option to zparseopts is described as this: " -K With this option, the arrays specified with the -a and -A options and with the `=array' forms are kept unchanged when none of the specs for them is used. This allows assignment of default values to them before calling zparseopts." Maybe I misunderstood something, but isn't my example the intended use of -K? Or is the condition "when none of the specs for them is used" really meant like "if one option is given, all other default values are emptied"? How would this make sense? I tried with zsh versions 5.0.2 and 4.3.10. Sebastian