aboutsummaryrefslogtreecommitdiffstats
path: root/native/dicttoolkit/src/command_executors/header_executor.cpp
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-11-08 09:52:40 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-11-15 09:58:19 +0900
commit79273b04772824a8c547e1a8d33900040a03264b (patch)
treefcc6b49f99fdc200ef83e80900f5991eb6795000 /native/dicttoolkit/src/command_executors/header_executor.cpp
parent80c4e0f68a1c7444f3394df8c15f53c420b99792 (diff)
downloadlatinime-79273b04772824a8c547e1a8d33900040a03264b.tar.gz
latinime-79273b04772824a8c547e1a8d33900040a03264b.tar.xz
latinime-79273b04772824a8c547e1a8d33900040a03264b.zip
Define arguments for commands in dicttoolkit.
Bug: 10059681 Change-Id: I1ceaeeaa9e2055c357fe969818498de9d6288862
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