feat: --add-all
This commit is contained in:
@@ -88,6 +88,7 @@ uv-run-sample-%: .venv ## uv run (project) sample/(xxx)
|
||||
--functions \
|
||||
--includes \
|
||||
--add-empty \
|
||||
--add-all \
|
||||
|
||||
.PHONY: ruff
|
||||
ruff: .venv ## ruff check
|
||||
|
||||
@@ -37,7 +37,8 @@ bool cp437(vec2 pos, int code)
|
||||
```txt
|
||||
usage: glsl-glyphs [-h] [-i INPUT_FILE] [-n NAME] [-o OUTPUT_FILE] [-g NAMES_FILE] [-s SETS_FILE] [-f | --functions | --no-functions]
|
||||
[--sentences-input SENTENCES_FILE] [--sentences-output OUTPUT_FILE] [--sentences-only | --no-sentences-only]
|
||||
[--includes | --no-includes] [--add-empty | --no-add-empty] [-v | --verbose | --no-verbose] [-q | --quiet | --no-quiet]
|
||||
[--includes | --no-includes] [--add-empty | --no-add-empty] [--add-all | --no-add-all] [-v | --verbose | --no-verbose]
|
||||
[-q | --quiet | --no-quiet]
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
@@ -61,6 +62,8 @@ options:
|
||||
use #include preprocessor in GLSL (forge)
|
||||
--add-empty, --no-add-empty
|
||||
add EMPTY tile at start of tileset if missing
|
||||
--add-all, --no-add-all
|
||||
add ALL set at start list
|
||||
-v, --verbose, --no-verbose
|
||||
more verbose logging
|
||||
-q, --quiet, --no-quiet
|
||||
|
||||
@@ -18,6 +18,7 @@ class Parameters:
|
||||
includes: bool = False
|
||||
sentences_only: bool = False
|
||||
add_empty: bool = False
|
||||
add_all: bool = False
|
||||
verbose: bool = False
|
||||
quiet: bool = False
|
||||
|
||||
@@ -105,6 +106,12 @@ def parse_parameters(args: typing.Sequence[str]) -> Parameters:
|
||||
default=default_values.verbose,
|
||||
help="add EMPTY tile at start of tileset if missing",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--add-all",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=default_values.verbose,
|
||||
help="add ALL set at start list",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
|
||||
@@ -33,6 +33,7 @@ class Reader:
|
||||
else None
|
||||
)
|
||||
self.add_empty = params.add_empty
|
||||
self.add_all = params.add_all
|
||||
self.log = logging.getLogger(__name__)
|
||||
|
||||
def read(self) -> tuple[list[Glyph], list[GlyphSet], list[Sentence]]:
|
||||
@@ -53,6 +54,9 @@ class Reader:
|
||||
|
||||
sets = self.__read_sets()
|
||||
|
||||
if self.add_all:
|
||||
sets.insert(0, GlyphSet(index=0, length=len(glyphs), name="ALL"))
|
||||
|
||||
sentences = self.__read_sentences(names)
|
||||
|
||||
return glyphs, sets, sentences
|
||||
|
||||
Reference in New Issue
Block a user