help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Extend the syntax to allow `declare x -a y`?


From: Eric Blake
Subject: Re: [Help-bash] Extend the syntax to allow `declare x -a y`?
Date: Mon, 26 Aug 2019 20:18:23 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 8/26/19 7:56 PM, Peng Yu wrote:
> `declare` does not allow both a scalar and an array.
> 
> $ declare x -a y
> -bash: declare: `-a': not a valid identifier
> $ declare x
> $ declare -a y
> 
> 
> But there seems to be no reason that this extension can not be done
> and would cause ambiguities. The advantage of adding these features is
> that variables can be declared by one statement. Can this feature be
> added?

Please no. GNU Coding Standards state that unless you have a really
strong reason otherwise, 'FOO x -a y' should behave the same as 'FOO -a
x y'.  You haven't given a strong enough reason otherwise.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]