ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit 43ec121383c57fadd500272fb8b9bd97238cf314
parent 82c611687f693f4284799f0e3e5e64f40aac5268
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu, 18 Oct 2018 11:11:09 +0200

Refactor rendering mode processing

Diffstat:
Msrc/main.c | 13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -175,7 +175,13 @@ int main(int argc, char *argv[]) { options.icecolors = true; break; case 'm': - options.mode = optarg; + if (!strcmp(optarg, "ced")) { + options.mode = ANSILOVE_MODE_CED; + } else if (!strcmp(optarg, "transparent")) { + options.mode = ANSILOVE_MODE_TRANSPARENT; + } else if (!strcmp(optarg, "workbench")) { + options.mode = ANSILOVE_MODE_WORKBENCH; + } break; case 'o': output = optarg; @@ -245,11 +251,6 @@ int main(int argc, char *argv[]) { } } - // default to empty string if mode option is not specified - if (!options.mode) { - options.mode = ""; - } - // default to 80x25 font if font option is not specified if (!options.font) { options.font = "80x25";