✨ Add version option
You can now ask the program for its version with `bemoji -v`.
This commit is contained in:
parent
afdfc53bfe
commit
8a31a36280
1 changed files with 8 additions and 5 deletions
13
bemoji
13
bemoji
|
@ -1,9 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Wanted features:
|
bm_version=0.1
|
||||||
#
|
|
||||||
# - [ ] limit maximum number of recent emoji
|
|
||||||
|
|
||||||
# Emoji default database location
|
# Emoji default database location
|
||||||
bm_db_location=${BEMOJI_DB_LOCATION:-"${XDG_DATA_HOME:-$HOME/.local/share}/bemoji"}
|
bm_db_location=${BEMOJI_DB_LOCATION:-"${XDG_DATA_HOME:-$HOME/.local/share}/bemoji"}
|
||||||
# Setting custom emoji list file location:
|
# Setting custom emoji list file location:
|
||||||
|
@ -40,8 +37,13 @@ usage() {
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
version() {
|
||||||
|
echo "v${bm_version}"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
# Get Options
|
# Get Options
|
||||||
while getopts ":f:D:tcepPh" o; do
|
while getopts ":f:D:tcepPhv" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
f) BEMOJI_CUSTOM_LIST="${OPTARG}" ;;
|
f) BEMOJI_CUSTOM_LIST="${OPTARG}" ;;
|
||||||
t) bm_default_cmd=_typeResult ;;
|
t) bm_default_cmd=_typeResult ;;
|
||||||
|
@ -51,6 +53,7 @@ while getopts ":f:D:tcepPh" o; do
|
||||||
p) bm_private_mode=true ;;
|
p) bm_private_mode=true ;;
|
||||||
P) bm_ignore_recent=true ;;
|
P) bm_ignore_recent=true ;;
|
||||||
h) usage 0 ;;
|
h) usage 0 ;;
|
||||||
|
v) version ;;
|
||||||
*) usage 1 ;;
|
*) usage 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue