File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11# :command.catch_all_filter
22% if catch_all_required?
3- if [[ ! -v other_args[@] ]]; then
3+ if [[ ${# other_args[@]} -eq 0 ]]; then
44 printf "<%= strings[:missing_required_argument] % { arg: catch_all_label, usage: usage_string } %> \n"
55 exit 1
66fi
Original file line number Diff line number Diff line change 11# :command.inspect_args
22inspect_args() {
33 readarray -t sorted_keys < < (printf '%s\n' "${!args[@]}" | sort)
4- if [[ -v args[@] ]] ; then
4+ if (( ${# args[@]} )) ; then
55 echo args:
66 for k in "${sorted_keys[@]}"; do echo "- \${args[$k]} = ${args[$k]}"; done
77 else
88 echo args: none
99 fi
1010
11- if [[ -v other_args[@] ]] ; then
11+ if (( ${# other_args[@]} )) ; then
1212 echo
1313 echo other_args:
1414 echo "- \${other_args[*]} = ${other_args[*]}"
Original file line number Diff line number Diff line change 11# :command.run
22run() {
3- declare -A args
4- declare -a other_args
5- declare -a input
3+ declare -A args=()
4+ declare -a other_args=()
5+ declare -a input=()
66 normalize_input "$@"
77 parse_requirements "${input[@]}"
88
99 <%- condition = "if" -%>
1010 <%- deep_commands.each do |command| -%>
1111 <%= condition %> [[ $action == "<%= command.action_name %> " ]]; then
12- if [[ -v args[--help] ]]; then
12+ if [[ ${ args[--help]:-} ]]; then
1313 long_usage=yes
1414 <%= command.function_name %> _usage
1515 else
You can’t perform that action at this time.
0 commit comments