From 9731fce9d6a7821c66ebcef0be763ef3e76b1de5 Mon Sep 17 00:00:00 2001 From: Hyunjee Kim Date: Thu, 17 Aug 2017 15:07:08 +0900 Subject: [PATCH] [i18ninfo] Add printing as ASCIIDOC format option Change-Id: Idb62044e609ebb55bfbc79a1bd0ae63306a005b6 Signed-off-by: Hyunjee Kim --- i18ninfo/i18ninfo.cpp | 4 ++++ i18ninfo/i18ninfo_argp.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/i18ninfo/i18ninfo.cpp b/i18ninfo/i18ninfo.cpp index 5120955..44aae51 100644 --- a/i18ninfo/i18ninfo.cpp +++ b/i18ninfo/i18ninfo.cpp @@ -1408,6 +1408,10 @@ int main(int argc, char *argv[]) allTest(); } + if (arguments.printASCII) { + ASCIIDOC_FLAG = 1; + } + if (arguments.showAllLocale) { showAllLocale(); } diff --git a/i18ninfo/i18ninfo_argp.h b/i18ninfo/i18ninfo_argp.h index ed0ee0e..97913ad 100644 --- a/i18ninfo/i18ninfo_argp.h +++ b/i18ninfo/i18ninfo_argp.h @@ -27,6 +27,7 @@ static struct argp_option options[] = { {"test-string-iter", 'S', "Type", OPTION_ARG_OPTIONAL, "String iteration test", 0 }, {"set-locale", 'l', "locale", 0, "Set specific locale", 0 }, {"show-ubidi", 'b', 0, OPTION_ARG_OPTIONAL, "Show examples of the Unicode Bidirectional Algorithm", 0 }, + {"print-ASCII", 'p', 0, 0, "Print results as the ASCIIDoc Format", 0 }, { 0 } }; @@ -45,6 +46,7 @@ struct arguments { int testString; int testStringIter; int showUbidi; + int printASCII; char *arg1; /* arg1 */ char **strings; /* [string…] */ @@ -158,6 +160,10 @@ parse_opt(int key, char *arg, struct argp_state *state) state->next++; } break; + case 'p': + arguments->arg_flag = 15; + arguments->printASCII = 1; + break; case ARGP_KEY_NO_ARGS: if (arguments->arg_flag == 0) { argp_usage(state); -- 2.34.1