opencontainers / image-tools

OCI Image Tooling
https://opencontainers.org
Apache License 2.0
266 stars 83 forks source link

Fix invalid variable name in bash completion script #229

Open kevinoid opened 3 years ago

kevinoid commented 3 years ago

Sourcing completions/bash/oci-image-tool in bash produces:

bash: __oci-image-tool_previous_extglob_setting=shopt: command not found
bash: eval: -i: invalid option
eval: usage: eval [arg ...]

This occurs because __oci-image-tool_previous_extglob_setting is not a valid variable name (see https://unix.stackexchange.com/q/23659).

Fix the variable name by replacing - with _. Since the variable is unset before the script finishes, this presents minimal compatibility risk.

Thanks for considering, Kevin