Skip to content

Conversation

@zappolowski
Copy link
Member

@zappolowski zappolowski commented Oct 11, 2023

The output of dunst -h differs from the one of dunst --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 to cmdline_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.

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.
@zappolowski zappolowski force-pushed the fix-commandline-handling branch from f7ae76d to 98452d7 Compare October 11, 2023 12:55
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.02%. Comparing base (2cd719a) to head (d844e1d).
⚠️ Report is 426 commits behind head on master.

Files with missing lines Patch % Lines
src/dunst.c 0.00% 5 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
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     
Flag Coverage Δ
unittests 66.02% <64.28%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fwsmit
Copy link
Member

fwsmit commented Oct 17, 2023

That's a great find! It even simplifies the code :)

Could you add the new command line options to the dunst.1.pod man page?

@zappolowski zappolowski force-pushed the fix-commandline-handling branch from c86ab2d to 67da151 Compare October 17, 2023 12:40
@zappolowski
Copy link
Member Author

zappolowski commented Oct 17, 2023

Could you add the new command line options to the dunst.1.pod man page?

Just did ... and also fixed the spelling in the manpage for --startup-notification. Basically, I'd prefer to have it that way, but changing it would be an incompatible change.

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.
@zappolowski zappolowski force-pushed the fix-commandline-handling branch from 67da151 to 62b669a Compare October 17, 2023 12:42
@fwsmit
Copy link
Member

fwsmit commented Oct 24, 2023

Thanks for the improvements! This will be merged now

@fwsmit fwsmit merged commit ecbb370 into dunst-project:master Oct 24, 2023
@zappolowski zappolowski deleted the fix-commandline-handling branch October 24, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants