__fish_config_interactive: Use variable-as-command

This removes a use of eval, and some duplication.
This commit is contained in:
Fabian Homborg
2018-10-21 15:31:49 +02:00
parent 09f77a355f
commit fc51c156cb

View File

@@ -126,12 +126,11 @@ function __fish_config_interactive -d "Initializations that should be performed
# Hence we'll call python directly.
# c_m_p.py should work with any python version.
set -l update_args -B $__fish_data_dir/tools/create_manpage_completions.py --manpath --cleanup-in '~/.config/fish/completions' --cleanup-in '~/.config/fish/generated_completions'
if command -qs python3
python3 $update_args >/dev/null 2>/dev/null &
else if command -qs python2
python2 $update_args >/dev/null 2>/dev/null &
else if command -qs python
python $update_args >/dev/null 2>/dev/null &
for py in python{3,2,}
if command -sq $py
$py $update_args >/dev/null 2>&1 &
break
end
end
end
end
@@ -228,7 +227,7 @@ function __fish_config_interactive -d "Initializations that should be performed
# Redirect stderr per #1155
fish_default_key_bindings 2>/dev/null
else
eval $fish_key_bindings 2>/dev/null
$fish_key_bindings 2>/dev/null
end
# Load user key bindings if they are defined
if functions --query fish_user_key_bindings >/dev/null