Simplified --stdout arg

This commit is contained in:
Dylan 2016-02-20 00:05:48 +11:00
parent ef74bd85ee
commit 75abd75765

33
fetch
View file

@ -2123,21 +2123,17 @@ prin () {
# Stdout {{{ # Stdout {{{
stdout () { stdout () {
printinfo () { for func in "${args[@]}"; do
index=1 case "$func" in
for func in "${args[@]}"; do "--"*) break ;;
*)
case "$func" in "get$func" 2>/dev/null
"--stdout") continue ;; eval output="\$$func"
"--"*) break ;; printf "$output "
*) ;;
case "${args[$((index + 1))]}" in "--"*) unset stdout_separator ;; esac esac
info "$func" done
;; exit
esac
index=$((index + 1))
done
}
} }
# }}} # }}}
@ -2492,12 +2488,13 @@ while [ "$1" ]; do
--stdout_separator) stdout_separator="$2" ;; --stdout_separator) stdout_separator="$2" ;;
--stdout_subtitles) stdout_subtitles="$2" ;; --stdout_subtitles) stdout_subtitles="$2" ;;
--stdout) --stdout)
stdout="on"
unset info_color colors
case "$2" in case "$2" in
"--"* | "") stdout="on" ;; "--"* | "") ;;
*) stdout="on"; args=("$@"); stdout ;; *) shift; args=("$@"); stdout ;;
esac esac
unset info_color colors
underline="off" underline="off"
image="off" image="off"
color_blocks="off" color_blocks="off"