Skip to content
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 getopt parameters #29

Merged
merged 2 commits into from
Aug 5, 2024
Merged

Conversation

dshoreman
Copy link
Contributor

The parameters passed to getopt have a few discrepancies which can cause unexpected behaviour depending on which args are passed.

  • Long-format --interval, --cycles and --packages-limit:
    Missing the : meant only the short options would receive the value
  • Short -d and long-format --devel args:
    Redundant :: for a flag that takes no value (mostly harmless)

The -n/--notify flag was also missing, which combined with shift 2 meant a command like waybar-updates -n -d would eat the -d.

Long-format options that need values weren't defined correctly causing
failure to parse the corresponding values from the command line.

This fixes it (single : for required, double for optional, none for none).
@savely-krasovsky
Copy link
Owner

Thank you! I didn't have much experience with bash script previously.

@savely-krasovsky savely-krasovsky merged commit 011725a into savely-krasovsky:master Aug 5, 2024
2 checks passed
@savely-krasovsky
Copy link
Owner

Released as update v0.4.0.

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.

2 participants