mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
add cmdline options to connect to or query database
This commit is contained in:
parent
5e5d004728
commit
70c141cf8e
13
aniwrapper
13
aniwrapper
@ -90,7 +90,7 @@ generate_span() {
|
||||
########
|
||||
# Main #
|
||||
########
|
||||
while getopts 'vhqcdf:-:t:T:' OPT; do
|
||||
while getopts 'vhqcdf:-:t:T:CQ:' OPT; do
|
||||
case "$OPT" in
|
||||
h)
|
||||
help_text
|
||||
@ -145,6 +145,17 @@ while getopts 'vhqcdf:-:t:T:' OPT; do
|
||||
esac
|
||||
CFG_FILE="$CFG_DIR/themes/$ROFI_THEME"
|
||||
;;
|
||||
C)
|
||||
logger "Connecting to history database -> $CFG_DIR/history.sqlite3"
|
||||
sqlite3 "$CFG_DIR/history.sqlite3"
|
||||
exit $?
|
||||
;;
|
||||
Q)
|
||||
query="$OPTARG"
|
||||
logger "DATABASE QUERY: $query"
|
||||
sqlite3 -line "$CFG_DIR/history.sqlite3" "$query"
|
||||
exit $?
|
||||
;;
|
||||
T)
|
||||
CFG_FILE="$OPTARG"
|
||||
[ ! -f "$CFG_FILE" ] && seppuku "config file $CFG_FILE does not exist"
|
||||
|
Loading…
Reference in New Issue
Block a user