implement version

This commit is contained in:
NRK
2021-05-02 00:02:41 +06:00
parent 776ac02ed2
commit deb114ea70

10
sxbm
View File

@ -8,8 +8,9 @@
# CONFIG #
##########
# Appname
# Appname and Version
APPNAME="sxbm"
VERSION="v0.1"
# Where all the data gets stored
# Respects XDG_DATA_HOME if set
@ -54,6 +55,12 @@ COMMANDS:
-v|--version print the version and exit\n\n"
}
version(){
printf "$APPNAME $VERSION\n"
printf "GPLv3 license\n"
printf "https://github.com/n-r-k/sxbm\n"
}
bm_add(){
[ -z "$1" ] && die "No arguments provided. Use '$APPNAME -h' for help"
@ -191,6 +198,7 @@ case "$1" in
usage && exit 0
;;
"-v"|"--version")
version && exit 0
;;
*)
die "Invalid command. Use '$APPNAME -h' for help!"