diff options
author | Thorsten Müller | 2022-08-01 08:58:51 +0200 |
---|---|---|
committer | Thorsten Müller | 2022-08-01 08:58:51 +0200 |
commit | 5ede38d452008b67fe14f36cc3674b89cdfd9c20 (patch) | |
tree | 7cc53e4b90389696f7e4a55b82b88daace7befe1 | |
parent | 25bfdd980718ae3c9a72a618d4bb24b905be76ad (diff) | |
download | aur-5ede38d452008b67fe14f36cc3674b89cdfd9c20.tar.gz |
add debug switch
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | pwc | 18 |
3 files changed, 21 insertions, 5 deletions
@@ -1,7 +1,7 @@ pkgbase = psono-cli pkgdesc = psono password manager cli pkgver = 1.0.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/meldron/psoco arch = x86_64 license = GPL @@ -9,7 +9,7 @@ pkgbase = psono-cli depends = jq depends = xclip source = pwc - sha256sums = 2ddcfc6681d17beb77bcd160e6db9155b7bc9b83efef39decf0c6931cbacb430 + sha256sums = 4ae786677e86cf3c31a611482cdeeb33120cfdbc1b80570ea33a71e3d70a2f64 source_x86_64 = https://github.com/meldron/psoco/archive/refs/tags/v0.1.0.tar.gz sha256sums_x86_64 = fdc8a3da8a8391e178aa3b7f9448ada8edfd8ea60e64b0e1f9e58d6afa40c996 @@ -1,7 +1,7 @@ # Maintainer: thorko contact@thorko.de pkgname=psono-cli pkgver=1.0.0 -pkgrel=1 +pkgrel=2 pkgdesc="psono password manager cli" arch=('x86_64') url='https://github.com/meldron/psoco' @@ -17,7 +17,7 @@ source=( ) sha256sums=( - '2ddcfc6681d17beb77bcd160e6db9155b7bc9b83efef39decf0c6931cbacb430' + '4ae786677e86cf3c31a611482cdeeb33120cfdbc1b80570ea33a71e3d70a2f64' ) build() { @@ -6,14 +6,23 @@ function help() { echo "will get all entries like pattern and copy it to your clipboard manager" echo "-a get all passwords on screen" echo "-p search for this pattern" + echo "-d debug messages" echo "-o print password also on screen" exit 0 } +function debug() { + local msg=$1 + if [ $debug -eq 1 ]; then + echo "$msg" + fi +} + onscreen=0 all=0 +debug=0 -while getopts "ap:h" opt; do +while getopts "dap:ho" opt; do case "$opt" in a) all=1 @@ -24,6 +33,9 @@ while getopts "ap:h" opt; do o) onscreen=1 ;; + d) + debug=1 + ;; h) help ;; @@ -43,7 +55,9 @@ fi declare -A pw while IFS="\n" read -r line; do name=$(echo $line |cut -d',' -f1) + debug "name: $name" id=$(echo $line| cut -d',' -f2) + debug "id: $id" pw["$name"]=$id done < <(psoco search -js $pattern | jq -r '.[].match|[.name,.id]|@csv' | tr -d \") @@ -62,6 +76,8 @@ fi select p in "${!pw[@]}"; do break done +debug "select: $p" +debug "array: ${pw[$p]}" user=$(psoco user ${pw[$p]}) password=$(psoco pwd ${pw[$p]}) |