mirror of
https://github.com/GRFreire/scripts.git
synced 2026-01-09 04:49:38 +00:00
Add --all flag to execute all colorscripts
This commit is contained in:
parent
a1fabc524e
commit
57ef06336c
@ -12,7 +12,8 @@ _help() {
|
|||||||
"-h, --help, help" "Print this help." \
|
"-h, --help, help" "Print this help." \
|
||||||
"-l, --list, list" "List all installed color scripts." \
|
"-l, --list, list" "List all installed color scripts." \
|
||||||
"-r, --random, random" "Run a random color script." \
|
"-r, --random, random" "Run a random color script." \
|
||||||
"-e, --exec, exec" "Run a specified color script by SCRIPT NAME or INDEX."
|
"-e, --exec, exec" "Run a specified color script by SCRIPT NAME or INDEX."\
|
||||||
|
"-a, --all, all" "List the outputs of all colorscripts with their SCRIPT NAME"
|
||||||
}
|
}
|
||||||
|
|
||||||
_list() {
|
_list() {
|
||||||
@ -66,6 +67,15 @@ _run_colorscript() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _run_all() {
|
||||||
|
for s in $DIR_COLORSCRIPTS/*
|
||||||
|
do
|
||||||
|
echo "$(echo $s | awk -F '/' '{print $NF}'):"
|
||||||
|
echo "$($s)"
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
case "$#" in
|
case "$#" in
|
||||||
0)
|
0)
|
||||||
_help
|
_help
|
||||||
@ -81,6 +91,9 @@ case "$#" in
|
|||||||
-r | --random | random)
|
-r | --random | random)
|
||||||
_random
|
_random
|
||||||
;;
|
;;
|
||||||
|
-a | --all | all)
|
||||||
|
_run_all
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Input error."
|
echo "Input error."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user