diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 14:48:29 +0200 |
| commit | e43eb1177872f52e949fb5f0f93396ed94b0d093 (patch) | |
| tree | 78b73af6a989fa2996d71b112e161b70d35081ef /home/dot_local/share/pass-extensions/executable_names.bash | |
| parent | 2f14a896e4b897bd747c24d7ad8e9e7bb3237d03 (diff) | |
move to chezmoi
Diffstat (limited to 'home/dot_local/share/pass-extensions/executable_names.bash')
| -rw-r--r-- | home/dot_local/share/pass-extensions/executable_names.bash | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/home/dot_local/share/pass-extensions/executable_names.bash b/home/dot_local/share/pass-extensions/executable_names.bash new file mode 100644 index 0000000..aa42ebf --- /dev/null +++ b/home/dot_local/share/pass-extensions/executable_names.bash @@ -0,0 +1,46 @@ +#!/bin/bash +# list all passwords in store + +pass_dir="$(pass directory)" +[ $? -ne 0 ] && exit 1 +cd "$pass_dir" + +usage() { + cat << EOF +usage: + pass names [-hl] + +options: + -l ignore symbolic links in password store + -h show this help +EOF + exit $1 +} + +ARGC=0 +while getopts lh OPT; do + [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND + case $OPT in + l) + opt_ignore_symlinks=y + ;; + h) usage 0 ;; + \?|*) usage 1 ;; + esac +done + +find_args=() + +if [ -n "$opt_ignore_symlinks" ] ; then + find_args+=(-P) # ignore symbolic links +else + find_args+=(-L) # follow symbolic links +fi +find_args+=(.) +find_args+=(-type d -name .git -prune) # skip .git directory +find_args+=(-o -type d -name .extensions -prune) # skip .extensions directory +find_args+=(-o -type f -name '*.gpg') # only .gpg files +find_args+=(-print) + +find "${find_args[@]}" | cut -c3- | rev | cut -c5- | rev + |