From a14225984551e96f785bd427203b3e61483bdc34 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 5 Aug 2015 22:52:06 +0200 Subject: cac templates: import from Makefile --- cac | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cac') diff --git a/cac b/cac index 358e4cd..c8151d4 100755 --- a/cac +++ b/cac @@ -86,6 +86,13 @@ __cac_cli__servers() { jq -r . $cac_servers_cache } +#? cac templates +#? Print cached templates JSON. +#? +__cac_cli__templates() { + jq -r . $cac_templates_cache +} + #? cac update #? Fetch and cache servers and templates JSON. #? @@ -353,11 +360,11 @@ _cac_listservers() {( )} _cac_listtemplates() {( - servers=$(_cac_get_api_v1 listtemplates) - status=$(echo $servers | jq -r .status) + templates=$(_cac_get_api_v1 listtemplates) + status=$(echo $templates | jq -r .status) if [ "$status" = ok ]; then - echo "$servers" | jq -r .data + echo "$templates" | jq -r .data else echo "cac_listtemplates: bad listtemplates status: $status" >&2 exit 1 -- cgit v1.2.3