Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions bin/pass-man
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
## which is inside a tomb. ##
#####################################

############
## CONFIG ##
############
# Timer to close tomb automatically
timer=6h

###############
## FUNCTIONS ##
###############
Expand All @@ -21,7 +15,7 @@ timer=6h
_usage() {
cat <<HELP

pass-man v1.3.3
pass-man v1.4.0
Written by Sandor Semsey, Copyright (C) 2020, License MIT

Usage: pass-man ACTION [TARGET] [EXTRA]...
Expand All @@ -47,7 +41,7 @@ _check-tomb-open() {
_vault-open() {
# shellcheck disable=SC2310
if ! _check-tomb-open; then
pass open -f --timer="${timer}"
pass open "${@}"

if ! _check-tomb-open; then
error-exit "Failed to open tomb."
Expand All @@ -60,7 +54,7 @@ _vault-open() {
_vault-close() {
# shellcheck disable=SC2310
if _check-tomb-open; then
pass close
pass close "${@}"

if _check-tomb-open; then
error-exit "Failed to close tomb."
Expand Down Expand Up @@ -104,8 +98,8 @@ action="${1:-}"

# Switch action
case "${action}" in
open) _vault-open ;;
close) _vault-close ;;
open) _vault-open "${@}" ;;
close) _vault-close "${@}" ;;
generate) _vault-generate "${@}" ;;
retrieve)
pass_path="${1:-}"
Expand Down