michaellihs / golab

Gitlab CLI written in Go
MIT License
27 stars 2 forks source link

Installing zsh-completion fails #1

Open amuessig opened 6 years ago

amuessig commented 6 years ago

Hi,

I wanted to install zsh-completion, which fails since there is no .golab file

golab zsh-completion
Config File ".golab" Not Found in "[/Users/<myuser> /Users/<myinstallpath>]"
Error: required parameter `-p` or `--path` not given - exiting
sage:
  golab zsh-completion [flags]    

Flags:
  -h, --help          help for zsh-completion
  -p, --path string   (required) Path into which to render ZSH completion    

Global Flags:
      --ca-file string   (optional) provides a .pem file to be used in certificates pool for SSL connection
      --ca-path string   (optional) provides a directory with .pem certificates to be used for SSL connection
      --config string    (optional) CURRENTLY NOT SUPPORTED config file (default is ./.golab.yml and $HOME/.golab.yml)
michaellihs commented 6 years ago

Hi,

thx for the feedback. The command golab zsh-completion might be a little misleading: what it does, is not installing zsh-completion but generating the auto-completion file for zsh. The very same file is inlcuded in zsh/_golab in the sources.

Since currently there is no differentiation between "offline" operations (requiring no connection to a Gitlab server) and "online" operations, golab will always fail if the .golab file can't be found. I consider this as a questionable behavior and will create an issue for it. Thanks for reporting.

For the time being, you can use zsh/_golab and copy it to one of the folders of the $FPATH and source your .zshrc as described in the README.

Regards, Michael

michaellihs commented 6 years ago

TODO: differentiate between commands that require login to a Gitlab server and such that don't (e.g. generating the zsh-completion file). Do not throw an error on commands that don't need a login, if no .golab file can be found.