From 8e6a548f634da4c29d62e53fb5b8a92e0d901678 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 6 Feb 2016 00:50:45 +1100 Subject: [PATCH] '--stdout' now takes arguments --- fetch | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/fetch b/fetch index 26afe4ea..80e901d4 100755 --- a/fetch +++ b/fetch @@ -2178,10 +2178,31 @@ while [ "$1" ]; do --scrot_cmd) scrot_cmd="$2" ;; # Stdout - --stdout) stdout="on"; image="off"; color_blocks="off" ;; --stdout_title) stdout_title="$2" ;; --stdout_seperator) stdout_seperator="$2" ;; --stdout_subtitles) stdout_subtitles="$2" ;; + --stdout) + stdout="on" + image="off" + color_blocks="off" + + for func in "$@"; do + case "$func" in + "--stdout") continue ;; + "--"*) break ;; + *) + # Call the function + get$func 2>/dev/null + eval output="\$${func}" + + # Print the output + printf "%s" "$output" + ;; + esac + done + + [ ! -z "$output" ] && exit + ;; # Other --config)