kontena / chpharos

Pharos version switcher
https://get.pharos.sh/
Apache License 2.0
3 stars 4 forks source link

Fix subcommand lookup when using a non-english locale #30

Closed kke closed 6 years ago

kke commented 6 years ago

Fixes #29

Chpharos failed to find subcommands when using a shells with non-english locale settings.

This is because something like type "_chpharos_subcommand_login" responds with something like "on funktio" or "ist eine funktion" and grepping for is a function fails to find a match.

Replaced with declare -FF "_chpharos_subcommand_login" &> /dev/null which seems to work both in bash and zsh.