Overhaul RGBDS man pages and help messages

This commit is contained in:
ISSOtm
2019-12-07 02:54:18 +01:00
parent 373762dedc
commit 34618e0294
13 changed files with 903 additions and 739 deletions

View File

@@ -52,9 +52,27 @@ static struct option const longopts[] = {
static void print_usage(void)
{
printf(
"usage: rgbgfx [-ADFfhmPTuVv] [-o outfile] [-a attrmap] [-d #] [-p palfile]\n"
" [-t tilemap] [-x #] infile\n");
fputs(
"usage: rgbgfx [<options>] <file>\n"
" -a, --attr-map <path> set the output attribute map file\n"
" -A, --output-attr-map output the attribute map to <input>.attrmap\n"
" -C, --color-curve use the GBC's color curve (color profile)\n"
" -D, --debug output debug info\n"
" -d, --depth <bpp> set the output image's depth to <bpp>bpp\n"
" -f, --fix make the input image an indexed PNG\n"
" -F, --fix-and-save same, but also save parameters inside the PNG\n"
" -h, --horizontal lay out tiles horizontally instead of vertically\n"
" -m, --mirror-tiles optimize out mirrored tiles\n"
" -o, --output <path> set the output binary file\n"
" -p, --palette <path> set the output palette file\n"
" -P, --output-palette output the palette file to <input>.pal\n"
" -t, --tilemap <path> set the output tilemap file\n"
" -T, --output-tilemap output the tilemap file to <input>.tilemap\n"
" -u, --unique-tiles optimize out identical tiles\n"
" -V, --version print RGBGFX version and exit\n"
" -v, --verbose print errors when parameters conflict with the PNG\n"
" -x, --trim-end <nbtiles> trim the end of the binary output by N tiles\n",
stderr);
exit(1);
}
@@ -69,9 +87,6 @@ int main(int argc, char *argv[])
struct Mapfile attrmap = {0};
char *ext;
if (argc == 1)
print_usage();
opts.tilemapfile = "";
opts.attrmapfile = "";
opts.palfile = "";
@@ -145,8 +160,10 @@ int main(int argc, char *argv[])
argc -= optind;
argv += optind;
if (argc == 0)
if (argc == 0) {
fputs("FATAL: no input files\n", stderr);
print_usage();
}
#define WARN_MISMATCH(property) \
warnx("The PNG's " property \