]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
argconfig: Increase the flag value
authorDaniel Wagner <dwagner@suse.de>
Thu, 10 Feb 2022 16:57:01 +0000 (17:57 +0100)
committerDaniel Wagner <dwagner@suse.de>
Thu, 10 Feb 2022 17:36:27 +0000 (18:36 +0100)
commit8f75eb067f7fd1b2f7683f82280cf74cb86e8c26
tree8fdd82c52573f2cf43b82539afb5170d82da4fcf
parent6744022feb1637caba41c15ef45fe886ecdfd727
argconfig: Increase the flag value

If the flag is provided several time increase the flag value. This is
a pretty ugly fix for how getopt_long_only() handles '--verbose' vs
'-v'. getopt_long_only() returns 0 when --verbose is used and 'v' for
-v hence we will not usually not take the short option path for
--verbose.

Break out in the short option parsing when non flag options are used.

Another uglyliness here is that it sets up long options differently
depending on short or long version is used. For the short version we
have to use value_addr.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
util/argconfig.c