Fix commandline options parsing
Fixes #105 (closed)
This MR accomplishes the following:
-
$ xfce4-terminal --titlegarbage foo
shouldn't be accepted as valid option. On current master it does. - As per POSIX
--
should act as an option delimiter -
$ xfce4-terminal -T=foo
shouldn't be accepted as valid option. - Allow grouping one more options with no args followed by at most one option with arg #105 (closed)
- POSIX says "a conforming implementation shall also permit applications to specify the option and option-argument in the same argument string without intervening characters." e.g.
$ xfce4-terminal -els
- For
$ xfce4-terminal -Hz
print "Unknown option "-z"" instead of "Unknown option "-Hz"" - Optimizes
--help/-h
,--version/-V
,--color-table
and--preferences
options handling.
Caveat (This is existing current behavior on master branch):
- From $ man xfce4-terminal
-x, --execute Execute the remainder of the command line inside the terminal
The "remainder of the command line" starts from the next arg of x
/--execute
. So,
$ xfce4-terminal -x ls
valid
$ xfce4-terminal --execute ls
valid
$ xfce4-terminal -xls
invalid
$ xfce4-terminal --execute=ls
invalid
This MR preserves this existing behavior.
Edited by Avinash Sonawane