Widgets


Just saw <Google Cloud Platform expands to Asia Pacific>. Can't wait to play around with Google Cloud Platform, but found that I can't use zsh auto completion with gcutil (gcloud tool).

If you have the similar shell message when using gcloud tool gcutil with zsh/oh-my-zsh, here is a reference solution:

  • /Users/username/google-cloud-sdk/completion.bash.inc:9: command not found: complete
1.
gcutil tool seems default use bash, but there's a zsh completion script file within this package version ( 0.9.20 (2014/03/24) ). I switch to use this file named "completion.zsh.inc" in my ~/.zshrc

2.
Then, I found that I still can't use the auto completion for even this simple one: "gcloud auth login". The root cause is the script file "path.bash.inc" calling to use `$BASH_SOURCE` in zsh. It makes empty `bin_path` which should direct to `{somewhere}/google-cloud-sdk/bin`. We can use `$0` to replace `$BASH_SOURCE` to get right path, and save as a file named "path.zsh.inc". The last step is update ~/.zshrc to use our new created "path.zsh.inc" file.

3.
Done :-)

----

Here are the scripts for zsh to use gcloud :-)
Enjoy!



----
Notes:

[1] Thanks to  Michael Zandstra's input: On linux, use double brackets in path.zsh.inc:3 for it to work:
if [[ "$apparent_sdk_dir" == "$script_link" ]]; then


1 Comments:

  1. Mr. Foxwoods Casino, LLC | Dr. Maryland
    Mr. Foxwoods Casino, LLC 안성 출장마사지 is 울산광역 출장안마 an online gaming 상주 출장마사지 company with a headquarters in 고양 출장안마 Davenport, Iowa. Dr. 김천 출장마사지 | www.mrfoxwoods.com.

    ReplyDelete

 
Top