add ZPASS_COPY_ON_EDIT config
This commit is contained in:
parent
76a1049d86
commit
dbe55ab7c0
3 changed files with 13 additions and 5 deletions
|
|
@ -45,6 +45,8 @@ usage()
|
|||
ZPASS_REMOTE_USER User for login
|
||||
ZPASS_REMOTE_PASSWORD Password for ftps/webdav login. Not for SSH
|
||||
ZPASS_PRIORITIZE_CLI Key prompt will always be done on CLI if stdin is a tty
|
||||
ZPASS_COPY_ON_EDIT Set to true, edit operations will copy the affected element
|
||||
> set , file , add , new
|
||||
|
||||
All operations can be shortened to their first char unless specified
|
||||
Unknown first argument will perform the operation described in 'ZPASS_UNK_OP_CALL' on that argument
|
||||
|
|
|
|||
10
src/main.sh
10
src/main.sh
|
|
@ -28,11 +28,11 @@ case $arg in
|
|||
ch|cached) get_key_cached >/dev/null ;;
|
||||
rmc|rm-cache) delete_cache 0 >/dev/null ;;
|
||||
c|create) create_file ;;
|
||||
t|tree) sanitize_paths "$@" && _tree "$@" ;;
|
||||
s|set) sanitize_paths "$1" && _set "$@" ;;
|
||||
f|file) sanitize_paths "$1" && fileset "$@" ;;
|
||||
a|add) sanitize_paths "$@" && add "$@" ;;
|
||||
n|new) sanitize_paths "$@" && new "$@" ;;
|
||||
t|tree) sanitize_paths "$@" && _tree "$@" ;;
|
||||
s|set) sanitize_paths "$1" && _set "$@" && cond_copy "$1" ;;
|
||||
f|file) sanitize_paths "$1" && fileset "$@" && cond_copy "$1";;
|
||||
a|add) sanitize_paths "$@" && add "$@" && shift $(($#-1)) && cond_copy "$1";;
|
||||
n|new) sanitize_paths "$@" && new "$@" && shift $(($#-1)) && cond_copy "$1";;
|
||||
g|get) sanitize_paths "$@" && get "$@" ;;
|
||||
x|copy) sanitize_paths "$1" && copy "$1" ;;
|
||||
l|ls|list) sanitize_paths "$@" && __NOPACK=y archive_exec ls -Ap1 -- "$@" ;;
|
||||
|
|
|
|||
|
|
@ -99,3 +99,9 @@ move()
|
|||
mv -f -- "$@"
|
||||
' zpass "$@"
|
||||
}
|
||||
|
||||
cond_copy() {
|
||||
if [ "$ZPASS_COPY_ON_EDIT" = true ] ; then
|
||||
copy "$1"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue