Make script silent/quiet by default
It's common for unix tools to be quiet by default, and verbose by toggle.
This commit is contained in:
parent
19fb4c78a1
commit
e0a0e9ce1c
12
kunst
12
kunst
|
@ -17,7 +17,7 @@ PROG_NAME=$(basename "$0")
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
printf "%s" "\
|
printf "%s" "\
|
||||||
usage: kunst [-h] [--size \"px\"] [--position \"+x+y\"][--music_dir \"path/to/dir\"] [--silent] [--version]
|
usage: kunst [-h] [--size \"px\"] [--position \"+x+y\"][--music_dir \"path/to/dir\"] [--verbose] [--version]
|
||||||
|
|
||||||
┬┌─┬ ┬┌┐┌┌─┐┌┬┐
|
┬┌─┬ ┬┌┐┌┌─┐┌┬┐
|
||||||
├┴┐│ ││││└─┐ │
|
├┴┐│ ││││└─┐ │
|
||||||
|
@ -29,14 +29,14 @@ optional arguments:
|
||||||
--size what size to display the album art in
|
--size what size to display the album art in
|
||||||
--position the position where the album art should be displayed
|
--position the position where the album art should be displayed
|
||||||
--music_dir the music directory which MPD plays from
|
--music_dir the music directory which MPD plays from
|
||||||
--silent dont show the output
|
--verbose show the output
|
||||||
--force-online force getting cover from the internet
|
--force-online force getting cover from the internet
|
||||||
--version show the version of kunst you are using
|
--version show the version of kunst you are using
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
[ ! "$SILENT" ] && echo "$PROG_NAME: $1"
|
[ "$VERBOSE" ] && echo "$PROG_NAME: $1"
|
||||||
}
|
}
|
||||||
|
|
||||||
logError() {
|
logError() {
|
||||||
|
@ -46,7 +46,7 @@ logError() {
|
||||||
|
|
||||||
|
|
||||||
# Parse the arguments
|
# Parse the arguments
|
||||||
options=$(getopt -o h --long position:,size:,music_dir:,version,force-online,silent,help -- "$@")
|
options=$(getopt -o h --long 'position:,size:,music_dir:,version,force-online,verbose,help' -- "$@")
|
||||||
eval set -- "$options"
|
eval set -- "$options"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
@ -74,8 +74,8 @@ while true; do
|
||||||
--force-online)
|
--force-online)
|
||||||
ONLINE_ALBUM_ART=true
|
ONLINE_ALBUM_ART=true
|
||||||
;;
|
;;
|
||||||
--silent)
|
--verbose)
|
||||||
SILENT=true
|
verbose=true
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in New Issue