From 295a62f538df8115d932f09e69e2950484e038c0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 23 Sep 2012 14:59:05 +0900 Subject: 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. --- src/OptionHandlerFactory.cc | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'src/OptionHandlerFactory.cc') 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 op(new DefaultOptionHandler (PREF_HELP, TEXT_HELP, - TAG_BASIC, + strHelpTag(TAG_BASIC), tagsStr, OptionHandler::OPT_ARG, 'h')); -- cgit