From be4b5f10b78a12acde8aeeba7073649677fb3953 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Wed, 26 Oct 2011 11:21:19 -0500 Subject: Fix 'show -all' --- functions/interpreter/vyatta-cfg-run | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/interpreter/vyatta-cfg-run b/functions/interpreter/vyatta-cfg-run index 524763d..25217b2 100644 --- a/functions/interpreter/vyatta-cfg-run +++ b/functions/interpreter/vyatta-cfg-run @@ -487,7 +487,17 @@ vyatta_cfg_cmd () local -a expanded_api_args=() local editlvl=$(cli-shell-api getEditLevelStr) vyatta_config_expand_compwords "${args[@]}" - if cli-shell-api validateTmplPath -- ${editlvl[*]} "${expanded_api_args[@]:1}"; then + if [[ "${expanded_api_args[@]:$[${#expanded_api_args[@]}-1]}" == "-all" ]] && + [[ "${expanded_api_args[0]}" == "show" ]]; then + if [[ $[${#expanded_api_args[@]}-2] -eq 0 ]]; then + vyatta_cfg_cmd_run "${expanded_api_args[@]}" + elif cli-shell-api validateTmplPath -- ${editlvl[*]} \ + "${expanded_api_args[@]:1:$[${#expanded_api_args[@]}-2]}"; then + vyatta_cfg_cmd_run "${expanded_api_args[@]}" + else + vyatta_cfg_validate_cmd "${expanded_api_args[@]}" + fi + elif cli-shell-api validateTmplPath -- ${editlvl[*]} "${expanded_api_args[@]:1}"; then vyatta_cfg_cmd_run "${expanded_api_args[@]}" else # find broken portion of command -- cgit v1.2.3