Harden Bash completion scripts against invalid states

Printing an error message is better than locking the shell up, honestly.
This commit is contained in:
ISSOtm
2022-08-09 22:30:50 +02:00
parent 3db3421f07
commit 12fed4c68e
4 changed files with 16 additions and 0 deletions

View File

@@ -209,6 +209,10 @@ _rgbasm_completions() {
done < <(compgen -A directory -- "${cur_word:$optlen}")
compopt -o filenames
;;
*)
echo >&2 "Internal completion error: invalid state \"$state\", please report this bug"
return 1
;;
esac
}

View File

@@ -175,6 +175,10 @@ _rgbfix_completions() {
done < <(compgen -A directory -- "${cur_word:$optlen}")
compopt -o filenames
;;
*)
echo >&2 "Internal completion error: invalid state \"$state\", please report this bug"
return 1
;;
esac
}

View File

@@ -161,6 +161,10 @@ _rgbgfx_completions() {
done < <(compgen -A directory -- "${cur_word:$optlen}")
compopt -o filenames
;;
*)
echo >&2 "Internal completion error: invalid state \"$state\", please report this bug"
return 1
;;
esac
}

View File

@@ -151,6 +151,10 @@ _rgblink_completions() {
done < <(compgen -A directory -- "${cur_word:$optlen}")
compopt -o filenames
;;
*)
echo >&2 "Internal completion error: invalid state \"$state\", please report this bug"
return 1
;;
esac
}