Index: tools/flags/SkCommandLineFlags.h |
diff --git a/tools/flags/SkCommandLineFlags.h b/tools/flags/SkCommandLineFlags.h |
index 5909413523143f87fd9d25eab0d565a37d82c082..7b931981b008a4910fed4333525bb24cbfbb5d20 100644 |
--- a/tools/flags/SkCommandLineFlags.h |
+++ b/tools/flags/SkCommandLineFlags.h |
@@ -204,7 +204,15 @@ SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(nam |
nullptr, \ |
&FLAGS_##name, \ |
defaultValue, \ |
- helpString) |
+ helpString, nullptr) |
+#define DEFINE_extended_string(name, defaultValue, helpString, extendedHelpString) \ |
+SkCommandLineFlags::StringArray FLAGS_##name; \ |
+SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(name), \ |
+ nullptr, \ |
+ &FLAGS_##name, \ |
+ defaultValue, \ |
+ helpString, \ |
+ extendedHelpString) |
// string2 allows specifying a short name. There is an assert that shortName |
// is only 1 character. |
@@ -214,7 +222,7 @@ SK_UNUSED static bool unused_##name = SkFlagInfo::CreateStringFlag(TO_STRING(nam |
TO_STRING(shortName), \ |
&FLAGS_##name, \ |
defaultValue, \ |
- helpString) |
+ helpString, nullptr) |
#define DECLARE_string(name) extern SkCommandLineFlags::StringArray FLAGS_##name; |
@@ -273,7 +281,7 @@ public: |
*/ |
static bool CreateBoolFlag(const char* name, const char* shortName, bool* pBool, |
bool defaultValue, const char* helpString) { |
- SkFlagInfo* info = new SkFlagInfo(name, shortName, kBool_FlagType, helpString); |
+ SkFlagInfo* info = new SkFlagInfo(name, shortName, kBool_FlagType, helpString, nullptr); |
info->fBoolValue = pBool; |
*info->fBoolValue = info->fDefaultBool = defaultValue; |
return true; |
@@ -287,14 +295,15 @@ public: |
*/ |
static bool CreateStringFlag(const char* name, const char* shortName, |
SkCommandLineFlags::StringArray* pStrings, |
- const char* defaultValue, const char* helpString); |
+ const char* defaultValue, const char* helpString, |
+ const char* extendedHelpString); |
/** |
* See comments for CreateBoolFlag. |
*/ |
static bool CreateIntFlag(const char* name, int32_t* pInt, |
int32_t defaultValue, const char* helpString) { |
- SkFlagInfo* info = new SkFlagInfo(name, nullptr, kInt_FlagType, helpString); |
+ SkFlagInfo* info = new SkFlagInfo(name, nullptr, kInt_FlagType, helpString, nullptr); |
info->fIntValue = pInt; |
*info->fIntValue = info->fDefaultInt = defaultValue; |
return true; |
@@ -302,7 +311,7 @@ public: |
static bool CreateIntFlag(const char* name, const char* shortName, int32_t* pInt, |
int32_t defaultValue, const char* helpString) { |
- SkFlagInfo* info = new SkFlagInfo(name, shortName, kInt_FlagType, helpString); |
+ SkFlagInfo* info = new SkFlagInfo(name, shortName, kInt_FlagType, helpString, nullptr); |
info->fIntValue = pInt; |
*info->fIntValue = info->fDefaultInt = defaultValue; |
return true; |
@@ -313,7 +322,7 @@ public: |
*/ |
static bool CreateDoubleFlag(const char* name, double* pDouble, |
double defaultValue, const char* helpString) { |
- SkFlagInfo* info = new SkFlagInfo(name, nullptr, kDouble_FlagType, helpString); |
+ SkFlagInfo* info = new SkFlagInfo(name, nullptr, kDouble_FlagType, helpString, nullptr); |
info->fDoubleValue = pDouble; |
*info->fDoubleValue = info->fDefaultDouble = defaultValue; |
return true; |
@@ -383,6 +392,7 @@ public: |
const SkString& shortName() const { return fShortName; } |
const SkString& help() const { return fHelpString; } |
+ const SkString& extendedHelp() const { return fExtendedHelpString; } |
SkString defaultValue() const { |
SkString result; |
@@ -421,11 +431,12 @@ public: |
} |
private: |
- SkFlagInfo(const char* name, const char* shortName, FlagTypes type, const char* helpString) |
+ SkFlagInfo(const char* name, const char* shortName, FlagTypes type, const char* helpString, const char* extendedHelpString) |
: fName(name) |
, fShortName(shortName) |
, fFlagType(type) |
, fHelpString(helpString) |
+ , fExtendedHelpString(extendedHelpString) |
, fBoolValue(nullptr) |
, fDefaultBool(false) |
, fIntValue(nullptr) |
@@ -453,6 +464,7 @@ private: |
SkString fShortName; |
FlagTypes fFlagType; |
SkString fHelpString; |
+ SkString fExtendedHelpString; |
bool* fBoolValue; |
bool fDefaultBool; |
int32_t* fIntValue; |