-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix commandline handling #1208
Fix commandline handling #1208
Conversation
Make it work for more than two possible values.
Now that `cmdline_find_option` can handle more than two cases repeated calls to `cmdline_get_*` are not needed anymore.
Calls to `cmdline_get_*` also modify the usage string. When the entries for help are not the last to set up all command line arguments set up afterwards don't show up in the usage.
All other options have a variant with just a single hyphen - be consistent.
f7ae76d
to
98452d7
Compare
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #1208 +/- ##
==========================================
- Coverage 66.03% 66.02% -0.01%
==========================================
Files 46 46
Lines 7595 7584 -11
==========================================
- Hits 5015 5007 -8
+ Misses 2580 2577 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
That's a great find! It even simplifies the code :) Could you add the new command line options to the |
c86ab2d
to
67da151
Compare
Just did ... and also fixed the spelling in the manpage for |
While at it also fix the spelling of `--startup_notification` and remove its argument as it is just a flag and doesn't take an argument.
67da151
to
62b669a
Compare
Thanks for the improvements! This will be merged now |
The output of
dunst -h
differs from the one ofdunst --help
due to how the usage string is constructed. Furthermore, the options-print
and--startup_notification
are not listed at all (due to incorrect ordering of options).This PR refactors
cmdline_find_option
to handle more than two alternatives (which fixes the first issue, when calls tocmdline_get_*
are merged) and reorders command line parsing in a way, that all currently available options are listed.NB: I've added
-startup_notification
as alternative to--startup_notification
as it was the only option only available with to hyphens and thus breaking consistency.