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

prefer a case statement instead of multiple [-tests on argument $1 #15

Closed
LucasLarson opened this issue Mar 1, 2022 · 0 comments · Fixed by #20
Closed

prefer a case statement instead of multiple [-tests on argument $1 #15

LucasLarson opened this issue Mar 1, 2022 · 0 comments · Fixed by #20
Labels
enhancement New feature or request

Comments

@LucasLarson
Copy link
Owner

[ "${1}" = -v ] || [ "${1}" = --verbose ] && set -x

As in:

case "${1-}" in
  -v | --verbose)
    set -x
    ;;
esac
@LucasLarson LucasLarson added the enhancement New feature or request label Mar 1, 2022
LucasLarson added a commit that referenced this issue Mar 1, 2022
Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
LucasLarson added a commit that referenced this issue Mar 1, 2022
* main:
  [ci skip] Updating changelog
  replace `[ $1 = 𝑥 ]` with `case` statement (fix #15) (#20)

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant