]> git.ipfire.org Git - thirdparty/util-linux.git/commit
setterm: use getopt_long_only() for option parsing
authorSami Kerola <kerolasa@iki.fi>
Sat, 17 May 2014 17:52:01 +0000 (18:52 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 19 May 2014 20:58:01 +0000 (21:58 +0100)
commit45c90b77e6aa67b86043734c294652be5aa9f8f7
treeffde49a91a9d52d948d6258e13d4bc83c4c56757
parent104ecc7e701fcec340ccc76d15bfc855f7786ced
setterm: use getopt_long_only() for option parsing

The getopt_long_only() has advantage of allowing one and two hyphen
versions of options, for example -help and --help.  Secondly the getopt
function family from libc can ensure some options requiring arguments,
while other are optional, and some should not accept argument at all.
That makes option parsing more robust.

Unfortunately retiring the old option parsing makes this change greater
than preferred.  Assuming not mistakes happen the new code works
functionally exactly as the old did.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/setterm.c