#!/usr/bin/env bash
#-*- mode: sh; -*-

AC_PATH=$(perl -MAmazon::Credentials -e 'print $INC{"Amazon/Credentials.pm"};')

if test -n $AC_PATH; then
    if test -n "$1" && test -n "$2"; then
        perl $AC_PATH --role "$1" --account "$2"
    else
        echo "usage: get-sso-credentials.sh role account"
    fi
else
    echo "could not find Amazon::Credentials"
fi
