kontena / chpharos

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

Subcommands not found when using non-english locales #29

Closed unclesamwk closed 6 years ago

unclesamwk commented 6 years ago

Hey,

on ubuntu 16.04 chparos work, but not on 18.04

sam@nb-sam:~ $ chpharos --version
error: unknown subcommand --version
sam@nb-sam:~ $ chpharos login
error: unknown subcommand login
sam@nb-sam: ~ $ set -xv ; chpharos login
set -xv ; chpharos login
+ set -xv
+ chpharos login
+ '[' 1 -eq 0 ']'
+ local subcommand
+ subcommand=_chpharos_subcommand_login
+ subcommand=_chpharos_subcommand_login
+ subcommand=_chpharos_subcommand_login
+ grep --color=auto -q function
+ type _chpharos_subcommand_login
+ _chpharos_error_echo 'unknown subcommand login'
+ echo 'error: unknown subcommand login'
error: unknown subcommand login
+ return 1

I've installed it manuelly via:

mkdir -p ~/.pharos/chpharos && \
  curl -sL https://raw.githubusercontent.com/kontena/chpharos/master/share/chpharos/chpharos.sh > ~/.pharos/chpharos.sh && \
  echo "source ~/.pharos/chpharos.sh" >> ~/.bash_profile

greetings Sam

kke commented 6 years ago

Strange.

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"
end

Test

$ vagrant up
$ vagrant ssh
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-33-generic x86_64)
vagrant@ubuntu-bionic:~$ mkdir -p ~/.pharos/chpharos && \
>   curl -sL https://raw.githubusercontent.com/kontena/chpharos/master/share/chpharos/chpharos.sh > ~/.pharos/chpharos.sh && \
>   echo "source ~/.pharos/chpharos.sh" >> ~/.bash_profile
vagrant@ubuntu-bionic:~$ exit
$ vagrant ssh
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-33-generic x86_64)
$ chpharos --version
chpharos 0.2.4
$ chpharos login
Log in using your Kontena Account credentials
Visit https://account.kontena.io/ to register a new account.

Username: user
Password:
Logged in
vagrant@ubuntu-bionic:~$ chpharos install 1.3.0
Downloading 'pharos-cluster' (23854176 bytes) from https://get.pharos.sh/versions/download/pharos-cluster-linux-amd64-1.3.0 ..
Verifying download SHA256 checksum.. OK
Downloading 'kubectl' (55400930 bytes) from https://storage.googleapis.com/kubernetes-release/release/v1.11.1/bin/linux/amd64/kubectl ..
Verifying download SHA256 checksum.. OK
Installed version 1.3.0. To set as current, use: chpharos use 1.3.0
vagrant@ubuntu-bionic:~$ chpharos use 1.3.0
using pharos version 1.3.0
vagrant@ubuntu-bionic:~$ pharos --version
pharos-cluster 1.3.0

Seems to work fine for me.

Anything special in your box, such as some alternative shell? Or perhaps some other language than English?

What does type _chpharos_subcommand_longdash_version say?

kke commented 6 years ago

I switched my box to German and I can reproduce your problem.

$ type _chpharos_subcommand_longdash_version
_chpharos_subcommand_longdash_version ist eine Funktion.
kke commented 6 years ago

Should work now, use

mkdir -p ~/.pharos/chpharos && \
  curl -sL https://raw.githubusercontent.com/kontena/chpharos/master/share/chpharos/chpharos.sh > ~/.pharos/chpharos.sh`

to update.

unclesamwk commented 6 years ago

Now it works, thank you.