diff options
Diffstat (limited to 'executables/bin/get-password')
| -rwxr-xr-x | executables/bin/get-password | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/executables/bin/get-password b/executables/bin/get-password index ca13d93..3b83bb7 100755 --- a/executables/bin/get-password +++ b/executables/bin/get-password @@ -5,32 +5,32 @@ VAULT="Private" CREDENTIAL="" main() { - parse_args "$@" - op read "op://$VAULT/$CREDENTIAL/password" + parse_args "$@" + op read "op://$VAULT/$CREDENTIAL/password" } parse_args() { - while [ $# -gt 0 ]; do - case "$1" in - --vault) - VAULT="$2" - shift 2 - ;; - --credential) - CREDENTIAL="$2" - shift 2 - ;; - *) - echo "Usage: $0 [--vault <name>] --credential <name>" - exit 1 - ;; - esac - done + while [ $# -gt 0 ]; do + case "$1" in + --vault) + VAULT="$2" + shift 2 + ;; + --credential) + CREDENTIAL="$2" + shift 2 + ;; + *) + echo "Usage: $0 [--vault <name>] --credential <name>" + exit 1 + ;; + esac + done - if [ -z "$CREDENTIAL" ]; then - echo "Invalid or empty CREDENTIAL" >&2 - exit 1 - fi + if [ -z "$CREDENTIAL" ]; then + echo "Invalid or empty CREDENTIAL" >&2 + exit 1 + fi } main "$@" |