summaryrefslogtreecommitdiffstats
path: root/remote/lib/report.sh
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-08-25 06:06:41 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-08-25 06:06:41 +0200
commit16e27beaa24c6c551eaa0d3e6d115017939593a1 (patch)
tree61aea994bfc76e9f0053b26a42406e456c2a962e /remote/lib/report.sh
parentb2d1ca40d5bd1015a37cc243000b636eefc3d128 (diff)
downloadconky-16e27beaa24c6c551eaa0d3e6d115017939593a1.tar.gz
conky-16e27beaa24c6c551eaa0d3e6d115017939593a1.tar.bz2
conky-16e27beaa24c6c551eaa0d3e6d115017939593a1.tar.xz
conky-16e27beaa24c6c551eaa0d3e6d115017939593a1.zip
Support multi-reports
Diffstat (limited to 'remote/lib/report.sh')
-rw-r--r--remote/lib/report.sh43
1 files changed, 39 insertions, 4 deletions
diff --git a/remote/lib/report.sh b/remote/lib/report.sh
index d808cc2..e6766a4 100644
--- a/remote/lib/report.sh
+++ b/remote/lib/report.sh
@@ -1,16 +1,51 @@
-function standart_report {
+function simple_report {
local generator="$1"
- local filter="${2:-print_table | decorate_table}"
+ local filter="${2:-cat}"
{
-
- #check_darksoft 12>/dev/fd/12 | print_table #| column -t -o " "
eval "$generator 12>/dev/fd/12 | $filter"
report=$(cat<&12)
} 12<<EOF
EOF
wait
+}
+
+
+function short_report {
+ local generator="$1"
+ local filter="${2:-print_table | decorate_table}"
+
+ configure_palete "$palete"
+ simple_report "$generator" "$filter"
+ finish
+}
+
+
+function standart_report {
+ local generator="$1"
+ local filter="${2:-print_table | decorate_table}"
+
+ configure_palete "$palete"
+ simple_report "$generator" "$filter"
print "$report"
echo
finish
}
+
+
+function report {
+ # Eval breaks output for some reason
+ case $report in
+ simple_report)
+ simple_report "$@"
+ ;;
+ short_report)
+ short_report "$@"
+ ;;
+ standart_report)
+ standart_report "$@"
+ ;;
+ default)
+ echo "Report is not implemented"
+ esac
+}