Fixed long-option argument parsing
Arguments of long-options (e.g. --program-flags='--foo=bar') may contain equal sign characters (=). Before this fix, these kind of options were split up into "program-flags" and "--foo" removing the last part of the argument. This was because only the first two colums from `awk -F= ...` were used. Now these kind of options will be split up correctly using Bash parameter expansion: "program-flags" and "--foo=bar". See man bash > Parameter Expansion for details. Tested with: sudo cp tdrop /usr/bin/tdrop tdrop -W --program-flags='-e tmux --role=tdropwindow' termite tdrop -W -f '-e tmux --role=tdropwindow' termite tdrop --normal-window -f '-e tmux --role=tdropwindow' termite It also works for boolen long-option flags without argument. In this case both OPTION and OPTARG are set to the long-option name. Boolean options don't use the OPTARG so it doesn't matter.long-opts
parent
ef9e436252
commit
21e8aa2522
Loading…
Reference in New Issue