server_list_detailed.sh 366 B

1234567891011121314151617181920212223242526
  1. #! /bin/bash
  2. usage() {
  3. cat << EOF
  4. Usage: ${0##*/} [-h] <project>
  5. List a project's servers, with details
  6. -h Print this help
  7. EOF
  8. }
  9. while getopts h opt; do
  10. case $opt in
  11. h) usage; exit 0 ;;
  12. esac
  13. done
  14. shift $(( OPTIND - 1 ))
  15. if [[ $# -eq 0 ]]; then
  16. 2>&1 usage
  17. exit 1
  18. fi
  19. . ~/.os_helpers
  20. get_server_list_detailed "$1" | jq -r '.servers'