[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] ping, --count=NUMBER
From: |
Alfred M. Szmidt |
Subject: |
Re: [bug-inetutils] ping, --count=NUMBER |
Date: |
Tue, 19 May 2009 21:13:07 -0400 |
Because of the way GNU getopt implements optional arguments. If an
option takes optional argument *and* that argument is given, it
must be specified the following way:
a) when used with short option, the argument must follow that
option immediately, without any intervening whitespace.
b) when used with long option, the argument must be separated from
the option word by exactly one equals sign.
In other words, if '-c' takes optional argument, then:
ping -c4
ping --count=4
means '-c' with the argument '4'. On the contrast, this:
ping -c 4
ping --count 4
means '--count' *without* explicit argument plus a standalone
argument '4'.
Thanks for the explanation. `--count 4' has never been valid with
argp.
As for the `-c 4' vs. `-c4' case, since we already use short-options
with optional arguments, the behaviour is already weird. In other
words, users already must think about if they are using a short option
with an optional argument, or not so they cannot depend on this
behaviour. So I see no harm in changing this, what do you think?
- [bug-inetutils] ping, --count=NUMBER, Alfred M. Szmidt, 2009/05/18
- Re: [bug-inetutils] ping, --count=NUMBER, Sergey Poznyakoff, 2009/05/19
- [bug-inetutils] Re: ping, --count=NUMBER, Simon Josefsson, 2009/05/19
- Re: [bug-inetutils] ping, --count=NUMBER, Alfred M. Szmidt, 2009/05/19
- Re: [bug-inetutils] ping, --count=NUMBER, Sergey Poznyakoff, 2009/05/19
- Re: [bug-inetutils] ping, --count=NUMBER,
Alfred M. Szmidt <=
- Re: [bug-inetutils] ping, --count=NUMBER, Sergey Poznyakoff, 2009/05/20
- Re: [bug-inetutils] ping, --count=NUMBER, Jeff Bailey, 2009/05/20
- Re: [bug-inetutils] ping, --count=NUMBER, Sergey Poznyakoff, 2009/05/20
- Re: [bug-inetutils] ping, --count=NUMBER, Alfred M. Szmidt, 2009/05/21
- Re: [bug-inetutils] ping, --count=NUMBER, Jeff Bailey, 2009/05/21
- Re: [bug-inetutils] ping, --count=NUMBER, Alfred M. Szmidt, 2009/05/21
- Re: [bug-inetutils] ping, --count=NUMBER, Sergey Poznyakoff, 2009/05/21
- Re: [bug-inetutils] ping, --count=NUMBER, Alfred M. Szmidt, 2009/05/21
- Re: [bug-inetutils] ping, --count=NUMBER, Sergey Poznyakoff, 2009/05/21
- Re: [bug-inetutils] ping, --count=NUMBER, Alfred M. Szmidt, 2009/05/22