The s
function takes a single string argument and runs an executable
located in the ./scripts/
directory that has the same path as the parameter
function s --argument SCRIPT_NAME
eval ./scripts/$SCRIPT_NAME
end
The print-scripts
function returns a space-separated list of all
executables located in ./scripts/
function print-scripts
find scripts -perm +111 -type f | sed 's$scripts/$$' | tr '\n' ' '
end
Setup the autocomplete for s
so that it autocompletes only the
executables located in the scripts directory.
complete --command s -a (print-scripts) --no-files