Lines Matching refs:flag

48 // called after all flag-values have been assigned, that is, after
74 "show help on the modules named by this flag value");
91 // Routines that pretty-print info about a flag. These use
93 // API exposes static info about a flag.
112 // Create a descriptive string for a flag.
114 string DescribeOneFlag(const CommandLineFlagInfo& flag) {
115 string main_part = (string(" -") + flag.name +
116 " (" + flag.description + ')');
161 AddString(string("type: ") + flag.type, &final_string, &chars_in_line);
162 // Append the effective default value (i.e., the value that the flag
163 // will have after the command line is parsed if the flag is not
165 // stored default value. This would happen if the value of the flag
172 // for the flag was parsed from the command line before "--help".
173 if (strcmp(flag.type.c_str(), "string") == 0) { // add quotes for strings
174 AddString(string("default: \"") + flag.current_value + string("\""),
177 AddString(string("default: ") + flag.current_value,
205 static string DescribeOneFlagInXML(const CommandLineFlagInfo& flag) {
209 string r("<flag>");
210 AddXMLTag(&r, "file", flag.filename);
211 AddXMLTag(&r, "name", flag.name);
212 AddXMLTag(&r, "meaning", flag.description);
213 AddXMLTag(&r, "default", flag.default_value);
214 AddXMLTag(&r, "current", flag.current_value);
215 AddXMLTag(&r, "type", flag.type);
216 r += "</flag>";
224 // These routines variously expose the registry's list of flag
225 // values. ShowUsage*() prints the flag-value information
228 // ShowXMLOfFlags() prints the flag-value information to stdout
264 // If substrings is empty, shows help for every file. If a flag's help message
266 // including gflags/gflags.h), then this flag will not be displayed by
278 for (vector<CommandLineFlagInfo>::const_iterator flag = flags.begin();
279 flag != flags.end();
280 ++flag) {
282 FileMatchesSubstring(flag->filename, substrings)) {
283 // If the flag has been stripped, pretend that it doesn't exist.
284 if (flag->description == kStrippedFlagHelp) continue;
285 found_match = true; // this flag passed the match!
286 if (flag->filename != last_filename) { // new file
287 if (Dirname(flag->filename) != Dirname(last_filename)) { // new dir!
292 fprintf(stdout, "\n Flags from %s:\n", flag->filename.c_str());
293 last_filename = flag->filename;
295 // Now print this flag
296 fprintf(stdout, "%s", DescribeOneFlag(*flag).c_str());
331 for (vector<CommandLineFlagInfo>::const_iterator flag = flags.begin();
332 flag != flags.end();
333 ++flag) {
334 if (flag->description != kStrippedFlagHelp)
335 fprintf(stdout, "%s\n", DescribeOneFlagInXML(*flag).c_str());
409 for (vector<CommandLineFlagInfo>::const_iterator flag = flags.begin();
410 flag != flags.end();
411 ++flag) {
412 if (!FileMatchesSubstring(flag->filename, substrings))
414 const string package = Dirname(flag->filename) + "/";