ICU-167 gencnval does not emit usage message unless needed

X-SVN-Rev: 458
This commit is contained in:
Vladimir Weinstein 1999-12-22 20:26:19 +00:00
parent 4ec0af1f34
commit 3c3a41085f

View File

@ -67,6 +67,8 @@ static Converter converters[MAX_ALIAS_COUNT];
static uint16_t converterCount=0; static uint16_t converterCount=0;
/* prototypes --------------------------------------------------------------- */ /* prototypes --------------------------------------------------------------- */
static void
usage(char *progname);
static void static void
parseLine(const char *line); parseLine(const char *line);
@ -100,12 +102,6 @@ main(int argc, char *argv[]) {
uint16_t stringOffset; uint16_t stringOffset;
bool_t haveCopyright=TRUE; bool_t haveCopyright=TRUE;
fprintf(stderr,
"usage: %s [-c[+|-]]\n"
"\tread convrtrs.txt and create " DATA_NAME "." DATA_TYPE "\n"
"\t\t-c[+|-] do (not) include a copyright notice\n",
argv[0]);
for(i=1; i<argc; ++i) { for(i=1; i<argc; ++i) {
arg=argv[i]; arg=argv[i];
if(arg[0]=='-') { if(arg[0]=='-') {
@ -113,7 +109,14 @@ main(int argc, char *argv[]) {
case 'c': case 'c':
haveCopyright= arg[2]=='+'; haveCopyright= arg[2]=='+';
break; break;
case 'h':
usage(argv[0]);
exit(0);
break;
default: default:
fprintf(stderr, "gencnval: invalid option\n");
usage(argv[0]);
exit(-1);
break; break;
} }
} }
@ -193,6 +196,15 @@ main(int argc, char *argv[]) {
return 0; return 0;
} }
static void
usage(char *progname) {
fprintf(stderr,
"usage: %s [-c[+|-]]\n"
"\tread convrtrs.txt and create " DATA_NAME "." DATA_TYPE "\n"
"\t\t-c[+|-] do (not) include a copyright notice\n",
progname);
}
static void static void
parseLine(const char *line) { parseLine(const char *line) {
uint16_t pos=0, start, limit, length, cnv; uint16_t pos=0, start, limit, length, cnv;