mirror of
https://github.com/gbdev/rgbds.git
synced 2026-01-22 00:11:53 +00:00
Implement warning diagnostic flags for RGBFIX (#1766)
* Implement warning diagnostic flags for RGBFIX * `-m/--mbc-type help` prints to stdout * Support `-m list` as well as `-m help` * Make invalid `rgbfix -l` characters a fatal error, like other invalid CLI arguments * Refactor fix/main.cpp into multiple files
This commit is contained in:
@@ -7,15 +7,15 @@ _rgbfix_completions() {
|
||||
# Empty long opt = it doesn't exit
|
||||
# See the `state` variable below for info about `state_after`
|
||||
declare -A opts=(
|
||||
[V]="version:normal"
|
||||
[h]="help:normal"
|
||||
[j]="non-japanese:normal"
|
||||
[s]="sgb-compatible:normal"
|
||||
[v]="validate:normal"
|
||||
[V]="version:normal"
|
||||
[W]="warning:warning"
|
||||
[w]=":normal"
|
||||
[C]="color-only:normal"
|
||||
[c]="color-compatible:normal"
|
||||
[f]="fix-spec:fix-spec"
|
||||
[i]="game-id:unk"
|
||||
[j]="non-japanese:normal"
|
||||
[k]="new-licensee:unk"
|
||||
[L]="custom-logo:glob-*.1bpp"
|
||||
[l]="old-licensee:unk"
|
||||
@@ -24,7 +24,9 @@ _rgbfix_completions() {
|
||||
[o]="output:glob-*.gb *.gbc *.sgb"
|
||||
[p]="pad-value:unk"
|
||||
[r]="ram-size:unk"
|
||||
[s]="sgb-compatible:normal"
|
||||
[t]="title:unk"
|
||||
[v]="validate:normal"
|
||||
)
|
||||
# Parse command-line up to current word
|
||||
local opt_ena=true
|
||||
@@ -140,6 +142,16 @@ _rgbfix_completions() {
|
||||
case "$state" in
|
||||
unk) # Return with no replies: no idea what to complete!
|
||||
;;
|
||||
warning)
|
||||
mapfile -t COMPREPLY < <(compgen -W "
|
||||
mbc
|
||||
overwrite
|
||||
sgb
|
||||
truncation
|
||||
all
|
||||
everything
|
||||
error" -P "${cur_word:0:$optlen}" -- "${cur_word:$optlen}")
|
||||
;;
|
||||
fix-spec)
|
||||
COMPREPLY=( "${cur_word}"{l,h,g,L,H,G} )
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user