-
Notifications
You must be signed in to change notification settings - Fork 367
Fix commandline handling #1208
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
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❌ Patch coverage is
Additional details and impacted files@@ 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. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
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 -hdiffers from the one ofdunst --helpdue to how the usage string is constructed. Furthermore, the options-printand--startup_notificationare not listed at all (due to incorrect ordering of options).This PR refactors
cmdline_find_optionto 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_notificationas alternative to--startup_notificationas it was the only option only available with to hyphens and thus breaking consistency.