Fix 'cut' working cross-platform

This commit is contained in:
vlad 2021-12-21 11:05:15 -08:00
parent 9b652111d5
commit b4d75c9070

7
View File

@ -38,7 +38,12 @@ redefine-functions-defined-with-selector-16() {
} }
_subcommands() { _subcommands() {
compgen -c ⚡ | cut -c2- prefix_length=1
while [[ "$(cut -c ${prefix_length}- <<< "⚡tomato")" != "tomato" ]]; do
prefix_length=$((prefix_length + 1))
done
compgen -c ⚡ | cut -c ${prefix_length}-
} }
_help-line() { _help-line() {