small pixel drawing of a pufferfish dotfiles

require arg for edit
j3s j3s@c3f.net
Thu, 28 Jan 2021 14:15:14 -0600
commit

6d7b6a5c000ae8e81996d48b04ecdb9ffa0d12bd

parent

a1c34365f953b8c34de39b72d06132f8fd670cd0

1 files changed, 7 insertions(+), 8 deletions(-)

jump to
M bin/pabin/pa

@@ -181,8 +181,9 @@ cd "$PA_DIR" ||

die "Can't access password directory" [ -f ~/.age/key.txt ] || pw_gen + pubkey=$(sed -n 's/.*\(age\)/\1/p' ~/.age/key.txt) - glob "$1" '[acds]*' && [ -z "$2" ] && + glob "$1" '[acdes]*' && [ -z "$2" ] && die "Missing [name] argument" glob "$1" '[cds]*' && [ ! -f "$2.age" ] &&

@@ -200,8 +201,6 @@

glob "$2" '*/*' && { mkdir -p "${2%/*}" || die "Couldn't create category '${2%/*}'"; } - pubkey=$(sed -n 's/.*\(age\)/\1/p' ~/.age/key.txt) - # Restrict permissions of any new files to # only the current user. umask 077

@@ -211,11 +210,11 @@ # state on exit or Ctrl+C.

[ -t 1 ] && trap 'stty echo icanon' INT EXIT case $1 in - a*) pw_add "$2" ;; - d*) pw_del "$2" ;; - e*) pw_edit "$2" ;; - s*) pw_show "$2" ;; - l*) pw_list ;; + a*) pw_add "$2" ;; + d*) pw_del "$2" ;; + e*) pw_edit "$2" ;; + s*) pw_show "$2" ;; + l*) pw_list ;; *) usage esac }