Remove -J, -P, and -V as they have long options equivalents.
Update documentation, small code cleanups.
This commit is contained in:
parent
7ac91c7401
commit
d5a194b7dd
|
@ -67,7 +67,7 @@ MAKEDEP = $(TOOLSDIR)/tools/makedep
|
||||||
WRC = $(TOOLSDIR)/tools/wrc/wrc
|
WRC = $(TOOLSDIR)/tools/wrc/wrc
|
||||||
WMC = $(TOOLSDIR)/tools/wmc/wmc
|
WMC = $(TOOLSDIR)/tools/wmc/wmc
|
||||||
WIDL = $(TOOLSDIR)/tools/widl/widl
|
WIDL = $(TOOLSDIR)/tools/widl/widl
|
||||||
WRCFLAGS = -J -m $(EXTRAWRCFLAGS)
|
WRCFLAGS = -m --nostdinc $(EXTRAWRCFLAGS)
|
||||||
LDPATH = @LDPATH@
|
LDPATH = @LDPATH@
|
||||||
DLLDIR = $(TOPOBJDIR)/dlls
|
DLLDIR = $(TOPOBJDIR)/dlls
|
||||||
LIBPORT = -L$(TOPOBJDIR)/libs/port -lwine_port
|
LIBPORT = -L$(TOPOBJDIR)/libs/port -lwine_port
|
||||||
|
|
|
@ -96,32 +96,27 @@ static char usage[] =
|
||||||
" -h Prints this summary.\n"
|
" -h Prints this summary.\n"
|
||||||
" -i file The name of the input file.\n"
|
" -i file The name of the input file.\n"
|
||||||
" -I path Set include search dir to path (multiple -I allowed)\n"
|
" -I path Set include search dir to path (multiple -I allowed)\n"
|
||||||
" -J Do not search the standard include path\n"
|
|
||||||
" -l lan Set default language to lan (default is neutral {0, 0})\n"
|
" -l lan Set default language to lan (default is neutral {0, 0})\n"
|
||||||
" -m Do not remap numerical resource IDs\n"
|
" -m Do not remap numerical resource IDs\n"
|
||||||
" -o file Output to file (default is infile.res)\n"
|
" -o file Output to file (default is infile.res)\n"
|
||||||
" -O format The output format (must be `res').\n"
|
" -O format The output format (must be `res').\n"
|
||||||
" -P program Specifies the preprocessor to use, including arguments.\n"
|
|
||||||
" -v Enable verbose mode.\n"
|
" -v Enable verbose mode.\n"
|
||||||
" -V Print version and exit\n"
|
|
||||||
" -w 16|32 Select win16 or win32 output (default is win32)\n"
|
" -w 16|32 Select win16 or win32 output (default is win32)\n"
|
||||||
" -W Enable pedantic warnings\n"
|
" -W Enable pedantic warnings\n"
|
||||||
#ifdef HAVE_GETOPT_LONG
|
|
||||||
"The following long options are supported:\n"
|
"The following long options are supported:\n"
|
||||||
" --input Synonym for -i.\n"
|
" --input Synonym for -i.\n"
|
||||||
" --output Synonym for -o.\n"
|
" --output Synonym for -o.\n"
|
||||||
|
" --output-format Synonym for -O.\n"
|
||||||
" --target Synonym for -F.\n"
|
" --target Synonym for -F.\n"
|
||||||
" --format Synonym for -O.\n"
|
" --preprocessor Specifies the preprocessor to use, including arguments.\n"
|
||||||
" --include-dir Synonym for -I.\n"
|
" --include-dir Synonym for -I.\n"
|
||||||
" --nostdinc Synonym for -J.\n"
|
|
||||||
" --define Synonym for -D.\n"
|
" --define Synonym for -D.\n"
|
||||||
" --language Synonym for -l.\n"
|
" --language Synonym for -l.\n"
|
||||||
|
" --nostdinc Disables searching the standard include path.\n"
|
||||||
" --use-temp-file Ignored for compatibility with windres.\n"
|
" --use-temp-file Ignored for compatibility with windres.\n"
|
||||||
" --no-use-temp-file Ignored for compatibility with windres.\n"
|
" --no-use-temp-file Ignored for compatibility with windres.\n"
|
||||||
" --preprocessor Synonym for -P.\n"
|
|
||||||
" --help Synonym for -h.\n"
|
" --help Synonym for -h.\n"
|
||||||
" --version Synonym for -V.\n"
|
" --version Print version and exit.\n"
|
||||||
#endif
|
|
||||||
"Input is taken from stdin if no sourcefile specified.\n"
|
"Input is taken from stdin if no sourcefile specified.\n"
|
||||||
"Debug level 'n' is a bitmask with following meaning:\n"
|
"Debug level 'n' is a bitmask with following meaning:\n"
|
||||||
" * 0x01 Tell which resource is parsed (verbose mode)\n"
|
" * 0x01 Tell which resource is parsed (verbose mode)\n"
|
||||||
|
@ -223,34 +218,30 @@ 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 =
|
||||||
"a:AB:cC:d:D:eEF:hH:i:I:Jl:LmnNo:O:P:rtTvVw:W";
|
"a:AB:cC:d:D:eEF:hH:i:I:l:LmnNo:O:P:rtTvVw:W";
|
||||||
#ifdef HAVE_GETOPT_LONG
|
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{ "input", 1, 0, 'i' },
|
{ "input", 1, 0, 'i' },
|
||||||
{ "output", 1, 0, 'o' },
|
{ "output", 1, 0, 'o' },
|
||||||
|
{ "output-format", 1, 0, 'O' },
|
||||||
{ "target", 1, 0, 'F' },
|
{ "target", 1, 0, 'F' },
|
||||||
{ "format", 1, 0, 'O' },
|
{ "preprocessor", 1, 0, 4 },
|
||||||
{ "include-dir", 1, 0, 'I' },
|
{ "include-dir", 1, 0, 'I' },
|
||||||
{ "nostdinc", 0, 0, 'J' },
|
|
||||||
{ "define", 1, 0, 'D' },
|
{ "define", 1, 0, 'D' },
|
||||||
{ "language", 1, 0, 'l' },
|
{ "language", 1, 0, 'l' },
|
||||||
{ "version", 0, 0, 'V' },
|
{ "nostdinc", 0, 0, 1 },
|
||||||
{ "help", 0, 0, 'h' },
|
|
||||||
{ "preprocessor", 1, 0, 'P' },
|
|
||||||
{ "use-temp-file", 0, 0, 2 },
|
{ "use-temp-file", 0, 0, 2 },
|
||||||
{ "no-use-temp-file", 0, 0, 3 },
|
{ "no-use-temp-file", 0, 0, 3 },
|
||||||
|
{ "help", 0, 0, 'h' },
|
||||||
|
{ "version", 0, 0, 5 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
extern char* optarg;
|
extern char* optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
int optc;
|
int optc;
|
||||||
#ifdef HAVE_GETOPT_LONG
|
|
||||||
int opti = 0;
|
int opti = 0;
|
||||||
#endif
|
|
||||||
int stdinc = 1;
|
int stdinc = 1;
|
||||||
int lose = 0;
|
int lose = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -276,19 +267,26 @@ int main(int argc,char *argv[])
|
||||||
strcat(cmdline, " ");
|
strcat(cmdline, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GETOPT_LONG
|
|
||||||
while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF)
|
while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF)
|
||||||
#else
|
|
||||||
while((optc = getopt(argc, argv, short_options)) != EOF)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
switch(optc)
|
switch(optc)
|
||||||
{
|
{
|
||||||
|
case 1:
|
||||||
|
stdinc = 0;
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
fprintf(stderr, "--use-temp-file option not yet supported, ignored.\n");
|
if (debuglevel) warning("--use-temp-file option not yet supported, ignored.\n");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
fprintf(stderr, "--no-use-temp-file option not yet supported, ignored.\n");
|
if (debuglevel) warning("--no-use-temp-file option not yet supported, ignored.\n");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if (strcmp(optarg, "cat") == 0) no_preprocess = 1;
|
||||||
|
else fprintf(stderr, "-P option not yet supported, ignored.\n");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
printf(version_string);
|
||||||
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
alignment = atoi(optarg);
|
alignment = atoi(optarg);
|
||||||
|
@ -339,10 +337,8 @@ int main(int argc,char *argv[])
|
||||||
else error("Too many input files.\n");
|
else error("Too many input files.\n");
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
wpp_add_include_path(optarg);
|
if (strcmp(optarg, "-") == 0) stdinc = 0;
|
||||||
break;
|
else wpp_add_include_path(optarg);
|
||||||
case 'J':
|
|
||||||
stdinc = 0;
|
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
{
|
{
|
||||||
|
@ -362,19 +358,11 @@ int main(int argc,char *argv[])
|
||||||
break;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
if (strcmp(optarg, "res"))
|
if (strcmp(optarg, "res"))
|
||||||
error("Output format %s not supported.", optarg);
|
warning("Output format %s not supported.", optarg);
|
||||||
break;
|
|
||||||
case 'P':
|
|
||||||
if (strcmp(optarg, "cat") == 0) no_preprocess = 1;
|
|
||||||
else fprintf(stderr, "-P option not yet supported, ignored.\n");
|
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
debuglevel = DEBUGLEVEL_CHAT;
|
debuglevel = DEBUGLEVEL_CHAT;
|
||||||
break;
|
break;
|
||||||
case 'V':
|
|
||||||
printf(version_string);
|
|
||||||
exit(0);
|
|
||||||
break;
|
|
||||||
case 'w':
|
case 'w':
|
||||||
if(!strcmp(optarg, "16"))
|
if(!strcmp(optarg, "16"))
|
||||||
win32 = 0;
|
win32 = 0;
|
||||||
|
|
|
@ -68,10 +68,6 @@ searched exclusively via the \fI\-I\fR set path, whereas the '""' quoted
|
||||||
filenames are first tried to be opened in the current directory. Also
|
filenames are first tried to be opened in the current directory. Also
|
||||||
resource statements with file references are located in the same way.
|
resource statements with file references are located in the same way.
|
||||||
.TP
|
.TP
|
||||||
.I \-J
|
|
||||||
Do not search the standard include path, look for include files only
|
|
||||||
in the directories explicitly specified with the \fI\-I\fR option.
|
|
||||||
.TP
|
|
||||||
.I \-l lan
|
.I \-l lan
|
||||||
Set default language to \fIlan\fR. Default is the neutral language 0
|
Set default language to \fIlan\fR. Default is the neutral language 0
|
||||||
(i.e. "LANGUAGE 0, 0").
|
(i.e. "LANGUAGE 0, 0").
|
||||||
|
@ -87,6 +83,10 @@ for example, big\-endian platforms. The \fI\-m\fR option is usefull for
|
||||||
source\-files that contain overlapping type\-IDs, or when the format of the
|
source\-files that contain overlapping type\-IDs, or when the format of the
|
||||||
resource is not 100% compliant.
|
resource is not 100% compliant.
|
||||||
.TP
|
.TP
|
||||||
|
.I \--nostdinc
|
||||||
|
Do not search the standard include path, look for include files only
|
||||||
|
in the directories explicitly specified with the \fI\-I\fR option.
|
||||||
|
.TP
|
||||||
.I \-o file
|
.I \-o file
|
||||||
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
|
||||||
|
@ -97,7 +97,7 @@ Sets the output format. The only supported \fformat\fR is 'res', which
|
||||||
is also the default format if this option is not specified. The option
|
is also the default format if this option is not specified. The option
|
||||||
exists mainly for compatibility with \fBwindres\fR.
|
exists mainly for compatibility with \fBwindres\fR.
|
||||||
.TP
|
.TP
|
||||||
.I \-P program
|
.I \--preprocessor program
|
||||||
This option may be used to specify the preprocessor to use, including any
|
This option may be used to specify the preprocessor to use, including any
|
||||||
leading arguments. If not specified, \fBwrc\fR uses its builtin processor.
|
leading arguments. If not specified, \fBwrc\fR uses its builtin processor.
|
||||||
To disable preprocessing, use \fB-P cat\fR.
|
To disable preprocessing, use \fB-P cat\fR.
|
||||||
|
@ -105,7 +105,7 @@ To disable preprocessing, use \fB-P cat\fR.
|
||||||
.I \-v
|
.I \-v
|
||||||
Turns on verbose mode (equivalent to -d 1).
|
Turns on verbose mode (equivalent to -d 1).
|
||||||
.TP
|
.TP
|
||||||
.I \-V
|
.I \--version
|
||||||
Print version end exit.
|
Print version end exit.
|
||||||
.TP
|
.TP
|
||||||
.I \-w 16|32
|
.I \-w 16|32
|
||||||
|
|
Loading…
Reference in New Issue