# HG changeset patch # User Matti Hamalainen # Date 1554314376 -10800 # Node ID 78a9140f02b1a119d01a16eba100aab30e7819b8 # Parent e0281dae2cb80319a21599e3c839cea52c3fb487 Improve help for spr/chr formats by listing the :mc and :sc flags at their descriptions instead of -i option help. diff -r e0281dae2cb8 -r 78a9140f02b1 tools/gfxconv.c --- a/tools/gfxconv.c Thu Mar 07 14:12:21 2019 +0200 +++ b/tools/gfxconv.c Wed Apr 03 20:59:36 2019 +0300 @@ -79,16 +79,17 @@ int flags; // DM_FMT_* flags, see libgfx.h int type; // Format type int format; // Subformat identifier + char *help; } DMConvFormat; static const DMConvFormat baseFormatList[] = { - { "ASCII text" , "asc" , DM_FMT_WR , FFMT_ASCII , 0 }, - { "ANSI colored text" , "ansi" , DM_FMT_WR , FFMT_ANSI , 0 }, - { "C64 bitmap image" , NULL , DM_FMT_RDWR , FFMT_BITMAP , -1 }, - { "C64 character/font data" , "chr" , DM_FMT_RDWR , FFMT_CHAR , 0 }, - { "C64 sprite data" , "spr" , DM_FMT_RDWR , FFMT_SPRITE , 0 }, + { "ASCII text" , "asc" , DM_FMT_WR , FFMT_ASCII , 0 , NULL }, + { "ANSI colored text" , "ansi" , DM_FMT_WR , FFMT_ANSI , 0 , NULL }, + { "C64 bitmap image" , NULL , DM_FMT_RDWR , FFMT_BITMAP , -1 , NULL }, + { "C64 character/font data" , "chr" , DM_FMT_RDWR , FFMT_CHAR , 0 , " (chr:mc/chr:sc for multi/singlecolor)" }, + { "C64 sprite data" , "spr" , DM_FMT_RDWR , FFMT_SPRITE , 0 , " (spr:mc/spr:sc for multi/singlecolor)" }, }; static const int nbaseFormatList = sizeof(baseFormatList) / sizeof(baseFormatList[0]); @@ -151,8 +152,8 @@ { 15, 'v', "verbose", "Increase verbosity", OPT_NONE }, { 3, 'o', "output", "Output filename", OPT_ARGREQ }, { 4, 's', "skip", "Skip N bytes in input from start (negative value will be offset from input end)", OPT_ARGREQ }, - { 1, 'i', "informat", "Set input format (spr[:mc|sc], chr[:mc|sc] or any supported image or C64 bitmap format, see --formats)", OPT_ARGREQ }, - { 5, 'f', "format", "Set output format (spr[:mc|sc], chr[:mc|sc] or any supported image or C64 bitmap format, see --formats)", OPT_ARGREQ }, + { 1, 'i', "informat", "Set input format (see --formats)", OPT_ARGREQ }, + { 5, 'f', "format", "Set output format (see --formats)", OPT_ARGREQ }, { 17, 'F', "formats", "List supported input/output formats", OPT_NONE }, { 8, 'q', "sequential", "Output sequential files (image output only)", OPT_NONE }, { 6, 'm', "colormap", "Set color index mapping (see below for information)", OPT_ARGREQ }, @@ -181,11 +182,12 @@ for (int i = 0; i < nconvFormatList; i++) { const DMConvFormat *fmt = &convFormatList[i]; - printf("%-6s| %c%c | %s\n", + printf("%-6s| %c%c | %s%s\n", fmt->fext ? fmt->fext : "", (fmt->flags & DM_FMT_RD) ? 'R' : ' ', (fmt->flags & DM_FMT_WR) ? 'W' : ' ', - fmt->name); + fmt->name, + fmt->help != NULL ? fmt->help : ""); } printf(