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:
Rangi
2025-07-26 12:11:52 -04:00
committed by GitHub
parent 87c10988ed
commit 0df5b7b86d
76 changed files with 1357 additions and 1006 deletions

View File

@@ -24,13 +24,13 @@ _rgbasm_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"
[E]="export-all:normal"
[v]="verbose:normal"
[V]="version:normal"
[W]="warning:warning"
[w]=":normal"
[b]="binary-digits:unk"
[D]="define:unk"
[E]="export-all:normal"
[g]="gfx-chars:unk"
[I]="include:dir"
[M]="dependfile:glob-*.mk *.d"
@@ -40,7 +40,7 @@ _rgbasm_completions() {
[Q]="q-precision:unk"
[r]="recursion-depth:unk"
[s]="state:unk"
[W]="warning:warning"
[v]="verbose:normal"
[X]="max-errors:unk"
)
# Parse command-line up to current word

View File

@@ -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} )
;;

View File

@@ -7,37 +7,38 @@ _rgbgfx_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"
[C]="color-curve:normal"
[m]="mirror-tiles:normal"
[O]="group-outputs:normal"
[u]="unique-tiles:normal"
[v]="verbose:normal"
[X]="mirror-x:normal"
[Y]="mirror-y:normal"
[Z]="columns:normal"
[a]="attr-map:glob-*.attrmap"
[V]="version:normal"
[W]="warning:warning"
[w]=":normal"
[A]="auto-attr-map:normal"
[a]="attr-map:glob-*.attrmap"
[B]="background-color:unk"
[b]="base-tiles:unk"
[C]="color-curve:normal"
[c]="colors:unk"
[d]="depth:unk"
[i]="input-tileset:glob-*.2bpp"
[L]="slice:unk"
[m]="mirror-tiles:normal"
[N]="nb-tiles:unk"
[n]="nb-palettes:unk"
[O]="group-outputs:normal"
[o]="output:glob-*.2bpp"
[p]="palette:glob-*.pal"
[P]="auto-palette:normal"
[q]="palette-map:glob-*.palmap"
[p]="palette:glob-*.pal"
[Q]="auto-palette-map:normal"
[q]="palette-map:glob-*.palmap"
[r]="reverse:unk"
[s]="palette-size:unk"
[t]="tilemap:glob-*.tilemap"
[T]="auto-tilemap:normal"
[W]="warning:warning"
[t]="tilemap:glob-*.tilemap"
[u]="unique-tiles:normal"
[v]="verbose:normal"
[X]="mirror-x:normal"
[x]="trim-end:unk"
[Y]="mirror-y:normal"
[Z]="columns:normal"
)
# Parse command-line up to current word
local opt_ena=true

View File

@@ -7,21 +7,21 @@ _rgblink_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"
[d]="dmg:normal"
[t]="tiny:normal"
[v]="verbose:normal"
[w]="wramx:normal"
[x]="nopad:normal"
[l]="linkerscript:glob-*"
[V]="version:normal"
[W]="warning:warning"
[M]="no-sym-in-map:normal"
[d]="dmg:normal"
[l]="linkerscript:glob-*"
[m]="map:glob-*.map"
[n]="sym:glob-*.sym"
[O]="overlay:glob-*.gb *.gbc *.sgb"
[o]="output:glob-*.gb *.gbc *.sgb"
[p]="pad:unk"
[W]="warning:warning"
[t]="tiny:normal"
[v]="verbose:normal"
[w]="wramx:normal"
[x]="nopad:normal"
)
# Parse command-line up to current word
local opt_ena=true