summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-13 01:30:27 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-13 01:30:27 +0200
commitb11e15a02b938f5cb3c6ce42f5307c92c0748d49 (patch)
treebfb3c9bb1bc54301fd1a01fa32b0140fc1b499fb
parent59b5377ab155e0a00f57287d8b55ca5b05f0974e (diff)
downloadpass-b11e15a02b938f5cb3c6ce42f5307c92c0748d49.tar.gz
pass-b11e15a02b938f5cb3c6ce42f5307c92c0748d49.tar.bz2
pass-b11e15a02b938f5cb3c6ce42f5307c92c0748d49.zip
Add --version switch, per request.
-rw-r--r--man/pass.13
-rwxr-xr-xsrc/password-store.sh24
2 files changed, 23 insertions, 4 deletions
diff --git a/man/pass.1 b/man/pass.1
index 4388401..0ef28c1 100644
--- a/man/pass.1
+++ b/man/pass.1
@@ -116,6 +116,9 @@ using the password store as the git repository.
.TP
\fBhelp\fP
Show usage message.
+.TP
+\fBversion\fP
+Show version information.
.SH SIMPLE EXAMPLES
diff --git a/src/password-store.sh b/src/password-store.sh
index ed86248..12ef62b 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -12,11 +12,21 @@ GIT="$PREFIX/.git"
export GIT_DIR="$GIT"
export GIT_WORK_TREE="$PREFIX"
+version() {
+ cat <<_EOF
+|-----------------------|
+| Password Store |
+| v.1.2.2 |
+| by zx2c4 |
+| |
+| Jason@zx2c4.com |
+| Jason A. Donenfeld |
+|-----------------------|
+_EOF
+}
usage() {
+ version
cat <<_EOF
-Password Store
-by Jason Donenfeld
- Jason@zx2c4.com
Usage:
$program init gpg-id
@@ -45,11 +55,13 @@ Usage:
specified by git-command-args.
$program help
Show this text.
+ $program version
+ Show version information.
_EOF
}
isCommand() {
case "$1" in
- init|ls|list|show|insert|edit|generate|remove|rm|delete|push|pull|git|help|--help) return 0 ;;
+ init|ls|list|show|insert|edit|generate|remove|rm|delete|push|pull|git|help|--help|version|--version) return 0 ;;
*) return 1 ;;
esac
}
@@ -99,6 +111,10 @@ case "$command" in
usage
exit 0
;;
+ version|--version)
+ version
+ exit 0
+ ;;
esac
if ! [[ -f $ID ]]; then