summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-10-03 20:40:28 +0000
committerPaul Buetow <paul@buetow.org>2011-10-03 20:40:28 +0000
commit898b831b751d3a9288aa3f8ebd69d07c86b374bc (patch)
tree459d5eedac40b69218cb368158f5dd25ce0c229d
parentdf70ec76413e355804f1cdbd3f5665dfa4ea8450 (diff)
some cosmetic stuff
-rwxr-xr-xpwgrep.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/pwgrep.sh b/pwgrep.sh
index 5b48474..29177d1 100755
--- a/pwgrep.sh
+++ b/pwgrep.sh
@@ -202,22 +202,20 @@ pwfls () {
pwfls $store
done
- elif [ -z "$arg" ]; then
+ else
local dir=$WORKDIR/$FILESTOREDIR
- if [ -z "$USEFILESTORECAT" ]; then
+
+ if [ -z "$USEFILESTORECATEGORY" ]; then
info Available file store categories:
dir=$WORKDIR/$FILESTOREDIR
+ info "(You may use '`basename $0` -d <CATEGORY>' to display containing files.)"
else
info Available files in store $FILESTORECATEGORY
dir=$WORKDIR/$FILESTOREDIR/$FILESTORECATEGORY
fi
+
[ ! -e $dir ] && error "Category ($dir) does not exist"
ls $dir
- else
- local -r dir=$WORKDIR/$FILESTOREDIR/$arg
- [ ! -e $dir ] && error "Category $arg ($dir) does not exist"
- info "All stored files (category $arg):"
- ls $dir | sed -n '/.gpg$/ { s/.gpg$//; p; }' | sort
fi
}
@@ -350,7 +348,7 @@ set_opts () {
# Alternate DB
DB=$(echo $ARGS | $AWK '{ print $2 }')
FILESTORECATEGORY=$DB
- USEFILESTORECAT=1
+ USEFILESTORECATEGORY=1
ARGS=$(echo $ARGS | $SED "s/-d $DB//")
DB=$DB.gpg
set_opts