Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
d6057e64
Commit
d6057e64
authored
11 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
wmc: Add support for long command-line options.
parent
1458856c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/wmc/wmc.c
+33
-19
33 additions, 19 deletions
tools/wmc/wmc.c
tools/wmc/wmc.man.in
+7
-7
7 additions, 7 deletions
tools/wmc/wmc.man.in
with
40 additions
and
26 deletions
tools/wmc/wmc.c
+
33
−
19
View file @
d6057e64
...
...
@@ -25,6 +25,9 @@
#include
<stdlib.h>
#include
<string.h>
#include
<signal.h>
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#endif
#include
"wmc.h"
#include
"utils.h"
...
...
@@ -33,28 +36,28 @@
static
const
char
usage
[]
=
"Usage: wmc [options...] [inputfile.mc]
\n
"
" -B x Set output byte-order x={n[ative], l[ittle], b[ig]}
\n
"
" (default is n[ative] which equals "
" -B x
Set output byte-order x={n[ative], l[ittle], b[ig]}
\n
"
"
(default is n[ative] which equals "
#ifdef WORDS_BIGENDIAN
"big"
#else
"little"
#endif
"-endian)
\n
"
" -c Set 'custom-bit' in values
\n
"
" -d Use decimal values in output
\n
"
" -D
Set debug flag
\n
"
" -h
T
his message
\n
"
" -H
file
Write headerfile to
file
(default is inputfile.h)
\n
"
" -i Inline messagetable(s)
\n
"
" -o
file
Output to
file
(default is in
put
file.rc)
\n
"
" -O
fmt Set
output format (rc, res, pot)
\n
"
" -P
dir
Directory
where to find po file
s
\n
"
" -u Inputfile is in unicode
\n
"
" -U Output unicode messagetable(s)
\n
"
" -v Show supported codepages and languages
\n
"
" -V Print version end exit
\n
"
" -W Enable pedantic warnings
\n
"
" -c
Set 'custom-bit' in values
\n
"
" -d
Use decimal values in output
\n
"
" -D
Set debug flag
\n
"
" -h
, --help Print t
his message
\n
"
" -H
FILE
Write header
file to
FILE
(default is inputfile.h)
\n
"
" -i
Inline messagetable(s)
\n
"
" -o
, --output=FILE
Output to
FILE
(default is infile.rc)
\n
"
" -O
, --output-format=FORMAT The
output format (
`
rc
'
,
`
res
'
,
or `
pot
'
)
\n
"
" -P
, --po-dir=DIR
Directory
containing po files for translation
s
\n
"
" -u
Input
file is in unicode
\n
"
" -U
Output unicode messagetable(s)
\n
"
" -v
Show supported codepages and languages
\n
"
" -V
, --version
Print version end exit
\n
"
" -W
, --pedantic
Enable pedantic warnings
\n
"
"Input is taken from stdin if no inputfile is specified.
\n
"
"Byteorder of unicode input is based upon the first couple of
\n
"
"bytes read, which should be 0x0000..0x00ff.
\n
"
...
...
@@ -128,7 +131,17 @@ static enum
FORMAT_POT
}
output_format
;
int
getopt
(
int
argc
,
char
*
const
*
argv
,
const
char
*
optstring
);
static
const
char
short_options
[]
=
"B:cdDhH:io:O:P:uUvVW"
;
static
const
struct
option
long_options
[]
=
{
{
"help"
,
0
,
NULL
,
'h'
},
{
"output"
,
1
,
NULL
,
'o'
},
{
"output-format"
,
1
,
NULL
,
'O'
},
{
"pedantic"
,
0
,
NULL
,
'W'
},
{
"po-dir"
,
1
,
NULL
,
'P'
},
{
"version"
,
0
,
NULL
,
'v'
}
};
static
void
segvhandler
(
int
sig
);
static
void
cleanup_files
(
void
)
...
...
@@ -147,6 +160,7 @@ int main(int argc,char *argv[])
extern
char
*
optarg
;
extern
int
optind
;
int
optc
;
int
opti
=
0
;
int
lose
=
0
;
int
ret
;
int
i
;
...
...
@@ -176,7 +190,7 @@ int main(int argc,char *argv[])
strcat
(
cmdline
,
" "
);
}
while
((
optc
=
getopt
(
argc
,
argv
,
"B:cdDhH:io:O:P:uUvVW"
))
!=
EOF
)
while
((
optc
=
getopt
_long
(
argc
,
argv
,
short_options
,
long_options
,
&
opti
))
!=
EOF
)
{
switch
(
optc
)
{
...
...
@@ -325,7 +339,7 @@ int main(int argc,char *argv[])
write_bin_files
();
break
;
case
FORMAT_RES
:
if
(
po_dir
)
add_translations
(
po_dir
);
add_translations
(
po_dir
);
write_res_file
(
output_name
);
break
;
case
FORMAT_POT
:
...
...
This diff is collapsed.
Click to expand it.
tools/wmc/wmc.man.in
+
7
−
7
View file @
d6057e64
...
...
@@ -34,8 +34,8 @@ NON-FUNCTIONAL; Use decimal values in output
.B \-D
Set debug flag. This results is a parser trace and a lot of extra messages.
.TP
.B \-h
Print an informative usage message.
.B
R
\-h
,\ \-\-help
Print an informative usage message
and exits
.
.TP
.BI \-H\ file
Write headerfile to \fIfile\fR. Default is \fIinputfile.h\fR.
...
...
@@ -45,14 +45,14 @@ Inline messagetable(s). This option skips the generation of all \fI.bin\fR files
and writes all output into the \fI.rc\fR file. This encoding is parsable with
wrc(1).
.TP
.B
I
\-o\ file
.B
R
\-o
,
\
\-\-output =\fI
file
Output to \fIfile\fR. Default is \fIinputfile.rc\fR.
.TP
.B
I
\-O\ format
.B
R
\-O
,
\
\-\-output\-format =\fI
format
Set the output format. Supported formats are \fBrc\fR (the default),
\fBres\fR, and \fBpot\fR.
.TP
.B
I
\-P\ directory
.B
R
\-P
,
\
\-\-po-dir =\fI
directory
Enable the generation of resource translations based on po files
loaded from the specified directory. That directory must follow the
gettext convention, in particular in must contain one \fI.po\fR file for
...
...
@@ -67,10 +67,10 @@ Write resource output in unicode formatted messagetable(s).
.B \-v
Show all supported codepages and languages.
.TP
.B \-V
.B
R
\-V
,\ \-\-version
Print version end exit.
.TP
.B \-W
.B
R
\-W
,\ \-\-pedantic
Enable pedantic warnings.
.SH EXTENSIONS
The original syntax is extended to support codepages more smoothly. Normally,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment