✨ 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
|
||||
|
||||
# Wanted features:
|
||||
#
|
||||
# - [ ] limit maximum number of recent emoji
|
||||
|
||||
bm_version=0.1
|
||||
# Emoji default database location
|
||||
bm_db_location=${BEMOJI_DB_LOCATION:-"${XDG_DATA_HOME:-$HOME/.local/share}/bemoji"}
|
||||
# Setting custom emoji list file location:
|
||||
|
@ -40,8 +37,13 @@ usage() {
|
|||
exit "$1"
|
||||
}
|
||||
|
||||
version() {
|
||||
echo "v${bm_version}"
|
||||
exit
|
||||
}
|
||||
|
||||
# Get Options
|
||||
while getopts ":f:D:tcepPh" o; do
|
||||
while getopts ":f:D:tcepPhv" o; do
|
||||
case "${o}" in
|
||||
f) BEMOJI_CUSTOM_LIST="${OPTARG}" ;;
|
||||
t) bm_default_cmd=_typeResult ;;
|
||||
|
@ -51,6 +53,7 @@ while getopts ":f:D:tcepPh" o; do
|
|||
p) bm_private_mode=true ;;
|
||||
P) bm_ignore_recent=true ;;
|
||||
h) usage 0 ;;
|
||||
v) version ;;
|
||||
*) usage 1 ;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue