Guest User

Untitled

a guest
Jan 16th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. goo () {
  2. local inp1 inp2
  3. inp1=$1
  4. inp2=$2
  5. if (( ! $# ))
  6. then
  7. inp1="-h"
  8. fi
  9. if [[ $inp1 == "-h" || $inp1 == "--help" ]]
  10. then
  11. echo "$0 - google cloud profile switching\n"
  12. echo "usage: $0 -h"
  13. echo "usage: $0 -l"
  14. echo "usage: $0 -p default\n\nOptions:"
  15. echo "\t-h, --help\t\t\t display help message and exit"
  16. echo "\t-l, --list\t\t\t list profiles"
  17. echo "\t-p, --profile=name\t\t switch profile"
  18. return 1
  19. elif [[ $inp1 == "-l" || $inp1 == "--list" ]]
  20. then
  21. gcloud config configurations list
  22. elif [[ ( $inp1 == "-p" || $inp1 == "--profile" ) && $inp2 != "" ]]
  23. then
  24. gcloud config configurations activate "$inp2"
  25. else
  26. echo "idk wtf"
  27. fi
  28. }
Add Comment
Please, Sign In to add comment