gistfile1.txt
· 529 B · Text
Eredeti
function command::_preprocess_flags() {
local -n _args_ref="$1"
local -a _filtered=()
for _arg in "${_args_ref[@]:-}"; do
local _consumed=false
local _mixin
for _mixin in "${_ACTIVE_MIXINS[@]:-}"; do
local _process_fn="command::mixin::${_mixin}::process"
if declare -f "$_process_fn" >/dev/null 2>&1; then
if "$_process_fn" "$_arg"; then
_consumed=true
break
fi
fi
done
$_consumed || _filtered+=("$_arg")
done
_args_ref=("${_filtered[@]:-}")
}
| 1 | function command::_preprocess_flags() { |
| 2 | local -n _args_ref="$1" |
| 3 | local -a _filtered=() |
| 4 | |
| 5 | for _arg in "${_args_ref[@]:-}"; do |
| 6 | local _consumed=false |
| 7 | local _mixin |
| 8 | for _mixin in "${_ACTIVE_MIXINS[@]:-}"; do |
| 9 | local _process_fn="command::mixin::${_mixin}::process" |
| 10 | if declare -f "$_process_fn" >/dev/null 2>&1; then |
| 11 | if "$_process_fn" "$_arg"; then |
| 12 | _consumed=true |
| 13 | break |
| 14 | fi |
| 15 | fi |
| 16 | done |
| 17 | $_consumed || _filtered+=("$_arg") |
| 18 | done |
| 19 | |
| 20 | _args_ref=("${_filtered[@]:-}") |
| 21 | } |