summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2019-11-30 14:32:26 +0800
committerxhe <xw897002528@gmail.com>2019-11-30 14:32:26 +0800
commit55a2119d06403e05808d89eedc9e94a20e87cbd3 (patch)
treebdc6d3f0417c7351a42c7d2e89a82056b9b0377a
parenta76f8ad7b1b65cbaeb88120bb15bb5d59e1db07b (diff)
downloadgettext-tiny-55a2119d06403e05808d89eedc9e94a20e87cbd3.tar.gz
msgfmt: support keyword, template, output options
follow https://github.com/sabotage-linux/gettext-tiny/issues/47. 'keyword=' is simply ignored. msgfmt will generate the output based on the template file and other sources. so 'template=' is the input file.
-rw-r--r--src/msgfmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/msgfmt.c b/src/msgfmt.c
index 6f4cd40..1120ff6 100644
--- a/src/msgfmt.c
+++ b/src/msgfmt.c
@@ -313,6 +313,7 @@ int main(int argc, char**argv) {
streq(A+2, "no-hash") ||
streq(A+2, "verbose") ||
streq(A+2, "statistics") ||
+ strstarts(A+2, "keyword=") ||
strstarts(A+2, "check-accelerators=") ||
strstarts(A+2, "resource=")
) {
@@ -335,8 +336,13 @@ int main(int argc, char**argv) {
} else if((locale = strstarts(A+2, "locale="))) {
} else if(streq(A+2, "check")) {
strict = true;
+ } else if(strstarts(A+2, "template=")) {
+ set_file(0, A+11, &in);
+ expect_in_fn = 0;
} else if(strstarts(A+2, "output-file=")) {
set_file(1, A+14, &out);
+ } else if(strstarts(A+2, "output=")) {
+ set_file(1, A+9, &out);
} else if(streq(A+2, "version")) {
version();
return 0;