mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Harden Bash completion scripts against invalid states
Printing an error message is better than locking the shell up, honestly.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user