File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ module Bashly
22 module Script
33 module Introspection
44 module Commands
5+ # Returns true if the command or any of its descendants has `catch_all`
6+ def catch_all_used_anywhere?
7+ deep_commands ( include_self : true ) . any? { |x | x . catch_all . enabled? }
8+ end
9+
510 # Returns a full list of the Command names and aliases combined
611 def command_aliases
712 commands . map ( &:aliases ) . flatten
Original file line number Diff line number Diff line change 1111> echo args: none
1212> fi
1313>
14+
15+ if catch_all_used_anywhere?
1416> if ((${#other_args[@]})); then
1517> echo
1618> echo other_args:
2022> done
2123> fi
2224>
25+ end
26+
2327if Settings.enabled? :deps_array
2428 > if ((${#deps[@]})); then
2529 > readarray -t sorted_keys < <(printf '%s\n' "${!deps[@]}" | sort)
@@ -31,6 +35,7 @@ if Settings.enabled? :deps_array
3135 > fi
3236 >
3337end
38+
3439if Settings.enabled? :env_var_names_array
3540 > if ((${#env_var_names[@]})); then
3641 > readarray -t sorted_names < <(printf '%s\n' "${env_var_names[@]}" | sort)
Original file line number Diff line number Diff line change 22
33> run() {
44> declare -g -A args=()
5+
6+ if catch_all_used_anywhere?
7+ > declare -g -a other_args=()
8+ end
9+
510if Settings.enabled? :deps_array
611 > declare -g -A deps=()
712end
8- > declare -g -a other_args=()
13+
914if Settings.enabled? :env_var_names_array
1015 > declare -g -a env_var_names=()
1116end
17+
1218> declare -g -a input=()
19+
1320if has_unique_args_or_flags?
1421 > declare -g -A unique_lookup=()
1522end
23+
1624> normalize_input "$@"
1725> parse_requirements "${input[@]}"
26+
1827if user_file_exist?('before')
1928 > before_hook
2029end
30+
2131>
2232> case "$action" in
23-
2433deep_commands.each do |command|
2534 > "{{ command.action_name }}") {{ command.function_name }}_command ;;
2635end
You can’t perform that action at this time.
0 commit comments