Fully support rgbasm -MC in Bash completion script

This commit is contained in:
Rangi42
2025-08-03 13:08:36 -04:00
parent fc9b614225
commit 903492cce2

View File

@@ -61,7 +61,7 @@ _rgbasm_completions() {
parse_short_opt() { parse_short_opt() {
# These options act like a long option (= takes up the entire word), but only use a single dash # These options act like a long option (= takes up the entire word), but only use a single dash
# So, they need some special handling # So, they need some special handling
if [[ "$1" = "-M"[GP] ]]; then if [[ "$1" = "-M"[CGP] ]]; then
state=normal state=normal
optlen=${#1} optlen=${#1}
return; return;
@@ -146,7 +146,7 @@ _rgbasm_completions() {
# It is, try to complete one # It is, try to complete one
mapfile -t COMPREPLY < <(compgen -W "${opts[*]%%:*}" -P '--' -- "${cur_word#--}") mapfile -t COMPREPLY < <(compgen -W "${opts[*]%%:*}" -P '--' -- "${cur_word#--}")
return 0 return 0
elif [[ "$cur_word" = '-M'[GPQT] ]]; then elif [[ "$cur_word" = '-M'[CGPQT] ]]; then
# These options act like long opts with no arguments, so return them and exactly them # These options act like long opts with no arguments, so return them and exactly them
COMPREPLY=( "$cur_word" ) COMPREPLY=( "$cur_word" )
return 0 return 0