Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d6057e64
Commit
d6057e64
authored
Oct 04, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmc: Add support for long command-line options.
parent
1458856c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
26 deletions
+40
-26
wmc.c
tools/wmc/wmc.c
+33
-19
wmc.man.in
tools/wmc/wmc.man.in
+7
-7
No files found.
tools/wmc/wmc.c
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 input
file.rc)
\n
"
" -O
fmt Set output format (rc, res, pot
)
\n
"
" -P
dir Directory where to find po file
s
\n
"
" -u
Input
file 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 in
file.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
:
...
...
tools/wmc/wmc.man.in
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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment