Add -fo as a synonym for -o, for compatibility with rc.

Line up help message, cleanup some error messages.
This commit is contained in:
Dimitrie O. Paun 2003-04-19 02:47:28 +00:00 committed by Alexandre Julliard
parent 9786b058df
commit 45864a7775
2 changed files with 30 additions and 26 deletions

View File

@ -81,7 +81,7 @@ static char usage[] =
" --language Synonym for -l\n" " --language Synonym for -l\n"
" --no-use-temp-file Ignored for compatibility with windres\n" " --no-use-temp-file Ignored for compatibility with windres\n"
" --nostdinc Disables searching the standard include path\n" " --nostdinc Disables searching the standard include path\n"
" --output Synonym for -o\n" " --output -fo Synonym for -o\n"
" --output-format Synonym for -O\n" " --output-format Synonym for -O\n"
" --pedantic Enable pedantic warnings\n" " --pedantic Enable pedantic warnings\n"
" --preprocessor Specifies the preprocessor to use, including arguments\n" " --preprocessor Specifies the preprocessor to use, including arguments\n"
@ -174,7 +174,7 @@ static void rm_tempfile(void);
static void segvhandler(int sig); static void segvhandler(int sig);
static const char* short_options = static const char* short_options =
"D:EF:hi:I:J:l:o:O:rU:v"; "D:Ef:F:hi:I:J:l:o:O:rU:v";
static struct option long_options[] = { static struct option long_options[] = {
{ "debug", 1, 0, 6 }, { "debug", 1, 0, 6 },
{ "define", 1, 0, 'D' }, { "define", 1, 0, 'D' },
@ -306,17 +306,21 @@ int main(int argc,char *argv[])
break; break;
case 'J': case 'J':
if (strcmp(optarg, "rc16") == 0) extensions = 0; if (strcmp(optarg, "rc16") == 0) extensions = 0;
else if (strcmp(optarg, "rc")) error("Output format %s not supported.", optarg); else if (strcmp(optarg, "rc")) error("Output format %s not supported.\n", optarg);
break; break;
case 'l': case 'l':
{ {
int lan; int lan;
lan = strtol(optarg, NULL, 0); lan = strtol(optarg, NULL, 0);
if (get_language_codepage(PRIMARYLANGID(lan), SUBLANGID(lan)) == -1) if (get_language_codepage(PRIMARYLANGID(lan), SUBLANGID(lan)) == -1)
error("Language %04x is not supported",lan); error("Language %04x is not supported\n", lan);
currentlanguage = new_language(PRIMARYLANGID(lan), SUBLANGID(lan)); currentlanguage = new_language(PRIMARYLANGID(lan), SUBLANGID(lan));
} }
break; break;
case 'f':
if (*optarg != 'o') error("Unknown option: -f%s\n", optarg);
optarg++;
/* fall through */
case 'o': case 'o':
if (!output_name) output_name = strdup(optarg); if (!output_name) output_name = strdup(optarg);
else error("Too many output files.\n"); else error("Too many output files.\n");
@ -328,7 +332,7 @@ int main(int argc,char *argv[])
wpp_del_define("__WIN32__"); wpp_del_define("__WIN32__");
wpp_del_define("__FLAT__"); wpp_del_define("__FLAT__");
} }
else if (strcmp(optarg, "res")) warning("Output format %s not supported.", optarg); else if (strcmp(optarg, "res")) warning("Output format %s not supported.\n", optarg);
break; break;
case 'r': case 'r':
/* ignored for compatibility with rc */ /* ignored for compatibility with rc */

View File

@ -79,7 +79,7 @@ in the directories explicitly specified with the \fI\-I\fR option.
.I \fB\-\-no\-use\-temp\-file\fR .I \fB\-\-no\-use\-temp\-file\fR
Ignored for compatibility with \fIwindres\fR. Ignored for compatibility with \fIwindres\fR.
.TP .TP
.I \fB\-o\fR, \fB\-\-output\fR=\fIfile\fR .I \fB\-o\fR, \fB\-fo\fR, \fB\-\-output\fR=\fIfile\fR
Write output to \fIfile\fR. Default is \fBinputfile.res\fR Write output to \fIfile\fR. Default is \fBinputfile.res\fR
with \fB.rc\fR stripped or \fBwrc.tab.res\fR if input is read with \fB.rc\fR stripped or \fBwrc.tab.res\fR if input is read
from standard input. from standard input.