summaryrefslogtreecommitdiff
path: root/src/OptionHandlerFactory.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-09-23 14:59:05 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-09-23 14:59:05 +0900
commit295a62f538df8115d932f09e69e2950484e038c0 (patch)
treedb32d5a6600e58716e646ac1d5b1573e0e02d531 /src/OptionHandlerFactory.cc
parent461a542c5e236a22bb4edba3fae9610df4ba44c6 (diff)
Rewritten help tags and various internal flag handling in OptionHandler
Now help tags are defined as enum values to avoid vector of strings. The internal flags are represented by bitmask to shrink size.
Diffstat (limited to 'src/OptionHandlerFactory.cc')
-rw-r--r--src/OptionHandlerFactory.cc27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc
index 1910f81c..cfb47001 100644
--- a/src/OptionHandlerFactory.cc
+++ b/src/OptionHandlerFactory.cc
@@ -2173,29 +2173,16 @@ OptionHandlerFactory::createOptionHandlers()
}
// Help Option
{
- static std::string tags[] = {
- TAG_BASIC,
- TAG_ADVANCED,
- TAG_HTTP,
- TAG_HTTPS,
- TAG_FTP,
- TAG_METALINK,
- TAG_BITTORRENT,
- TAG_COOKIE,
- TAG_HOOK,
- TAG_FILE,
- TAG_RPC,
- TAG_CHECKSUM,
- TAG_EXPERIMENTAL,
- TAG_DEPRECATED,
- TAG_HELP,
- TAG_ALL
- };
- static std::string tagsStr = strjoin(vbegin(tags), vend(tags), ", ");
+ std::string tagsStr;
+ for(int i = 0; i < MAX_HELP_TAG; ++i) {
+ tagsStr += strHelpTag(i);
+ tagsStr += ", ";
+ }
+ tagsStr += STR_TAG_ALL;
SharedHandle<OptionHandler> op(new DefaultOptionHandler
(PREF_HELP,
TEXT_HELP,
- TAG_BASIC,
+ strHelpTag(TAG_BASIC),
tagsStr,
OptionHandler::OPT_ARG,
'h'));