aboutsummaryrefslogtreecommitdiff
path: root/otp.bash
diff options
context:
space:
mode:
authorLucid One <LucidOne@users.noreply.github.com>2018-03-07 01:58:00 -0500
committerTad Fisher <tadfisher@gmail.com>2018-03-06 23:29:58 -0800
commit742aaaab15a78bce52fbe5bed4bcc29cdfca7ee8 (patch)
tree767179ae93afd0d3f5d6e04cb5e5631221453128 /otp.bash
parent694d10db8fb714d1dc69ec50c0298833a7922088 (diff)
Added support for `pass otp --version`
Diffstat (limited to 'otp.bash')
-rwxr-xr-xotp.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/otp.bash b/otp.bash
index 447af1e..33aca78 100755
--- a/otp.bash
+++ b/otp.bash
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# []
+VERSION="1.1.0"
OATH=$(which oathtool)
## source: https://gist.github.com/cdown/1163649
@@ -185,6 +186,11 @@ _EOF
exit 0
}
+cmd_otp_version() {
+ echo $VERSION
+ exit 0
+}
+
cmd_otp_insert() {
local opts force=0 echo=0 from_secret=0
opts="$($GETOPT -o fesi:a: -l force,echo,secret,issuer:,account: -n "$PROGRAM" -- "$@")"
@@ -398,6 +404,7 @@ cmd_otp_validate() {
case "$1" in
help|--help|-h) shift; cmd_otp_usage "$@" ;;
+ version|--version) shift; cmd_otp_version "$@" ;;
insert|add) shift; cmd_otp_insert "$@" ;;
append) shift; cmd_otp_append "$@" ;;
uri) shift; cmd_otp_uri "$@" ;;