aboutsummaryrefslogtreecommitdiffstats
path: root/native/dicttoolkit/src/command_executors/header_executor.cpp
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-11-16 17:23:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-16 17:23:56 +0000
commite7a72de8c28662e7a7855528d80c6a22a15fbcde (patch)
treeca5f5758ed63ef4ba1a8b36417e6b16db103ba3d /native/dicttoolkit/src/command_executors/header_executor.cpp
parent37f5b0d4ff4e4abbd3f8da8b606aef7ac8340485 (diff)
parent79273b04772824a8c547e1a8d33900040a03264b (diff)
downloadlatinime-e7a72de8c28662e7a7855528d80c6a22a15fbcde.tar.gz
latinime-e7a72de8c28662e7a7855528d80c6a22a15fbcde.tar.xz
latinime-e7a72de8c28662e7a7855528d80c6a22a15fbcde.zip
Merge "Define arguments for commands in dicttoolkit."
Diffstat (limited to 'native/dicttoolkit/src/command_executors/header_executor.cpp')
-rw-r--r--native/dicttoolkit/src/command_executors/header_executor.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/native/dicttoolkit/src/command_executors/header_executor.cpp b/native/dicttoolkit/src/command_executors/header_executor.cpp
index 068a62c31..b3d273b4e 100644
--- a/native/dicttoolkit/src/command_executors/header_executor.cpp
+++ b/native/dicttoolkit/src/command_executors/header_executor.cpp
@@ -30,9 +30,19 @@ const char *const HeaderExecutor::COMMAND_NAME = "header";
/* static */ void HeaderExecutor::printUsage() {
printf("*** %s\n", COMMAND_NAME);
- printf("Usage: %s\n", COMMAND_NAME);
- printf("Prints the header contents of a dictionary file.\n\n");
+ getArgumentsParser().printUsage(COMMAND_NAME,
+ "Prints the header contents of a dictionary file.");
}
+/* static */ const ArgumentsParser HeaderExecutor::getArgumentsParser() {
+ std::unordered_map<std::string, OptionSpec> optionSpecs;
+ optionSpecs["p"] = OptionSpec::switchOption("(plumbing) produce output suitable for a script");
+
+ const std::vector<ArgumentSpec> argumentSpecs = {
+ ArgumentSpec::singleArgument("dict", "prints the header contents of a dictionary file")
+ };
+
+ return ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs));
+}
} // namespace dicttoolkit
} // namespace latinime