]> git.ipfire.org Git - thirdparty/util-linux.git/commit
treewide: fix optional arguments usage
authorKarel Zak <kzak@redhat.com>
Mon, 7 Apr 2025 11:49:43 +0000 (13:49 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Apr 2025 08:51:16 +0000 (10:51 +0200)
commita3cff26d4b01ef19763964527e4270a105dc48e5
treebef125f8a5faa7a9e28ce1d95313fa1ac785c4f2
parente28ce84b2ebec03082dd9045e9be18785ec4dbd2
treewide: fix optional arguments usage

In some parts of the code, the optional argument handling is missing
for cases where the argument starts with '='. This is particularly
important for short options with optional arguments, as suggested by
our man pages. The libc getopt_long() handles this for long options,
but for short options, it's our responsibility.

Note that some argument parsing functions (mostly colormode_or_err())
already implement this, as they are usually used with optional
arguments.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit c4a24f5301ec9779a0492dd110824c2ce813f3eb)
lsfd-cmd/lsfd.c
misc-utils/enosys.c
misc-utils/uuidd.c
misc-utils/wipefs.c
sys-utils/ipcrm.c
sys-utils/nsenter.c