ref: 157fda2bc85b54a608bdb0cf5149c8a01046c51a
parent: c5ce3ae178afdfc7c17e7ea66fe50705e8d5f171
author: bentley <[email protected]>
date: Thu Jan 14 19:29:10 EST 2010
xlink: fix usage printing to match new options (and rgbfix format)
--- a/include/link/main.h
+++ b/include/link/main.h
@@ -3,7 +3,7 @@
#include "link/types.h"
-extern void PrintUsage(void);
+extern void usage(void);
extern SLONG fillchar;
extern char smartlinkstartsymbol[256];
--- a/src/link/main.c
+++ b/src/link/main.c
@@ -37,20 +37,14 @@
*
*/
-void
-PrintUsage(void)
+static void
+usage(void)
{
printf("xLink v" LINK_VERSION " (part of ASMotor " ASMOTOR_VERSION
- ")\n\n" "Usage: xlink [options] linkfile\n"
- "Options:\n\t-h\t\tThis text\n"
- "\t-m<mapfile>\tWrite a mapfile\n"
- "\t-n<symfile>\tWrite a NO$GMB compatible symfile\n"
- "\t-z<hx>\t\tSet the byte value (hex format) used for uninitialised\n"
- "\t\t\tdata (? for random, default is 0x00)\n"
- "\t-s<symbol>\tPerform smart linking starting with <symbol>\n"
- "\t-t\t\tOutput target\n" "\t\t-tg\tGameboy ROM image(default)\n"
- "\t\t-ts\tGameboy small mode (32kB)\n"
- "\t\t-tp\tPsion2 reloc module\n");
+ ")\n\n");
+ printf("usage: xlink [m mapfile] [-n symfile] [-s symbol] [-tg | -ts | -tp]\n");
+ printf("\t [-z pad_value] linkfile\n");
+
exit(0);
}
/*
@@ -126,7 +120,7 @@
SLONG argn = 0;
if (argc == 1)
- PrintUsage();
+ usage();
while ((ch = getopt(argc, argv, "m:n:s:t:z:")) != -1) {
switch (ch) {
@@ -169,7 +163,7 @@
}
break;
default:
- PrintUsage();
+ usage();
/* NOTREACHED */
}
}
@@ -185,7 +179,7 @@
Output();
CloseMapfile();
} else
- PrintUsage();
+ usage();
return (0);
}