Unverified Commit 9e227c0a authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #361 from gydong/master

fix the display of gflag default values of builtin
parents 6d153dd7 8f7eceb6
// Copyright (c) 2015 Baidu, Inc. // Copyright (c) 2015 Baidu, Inc.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <ostream> #include <ostream>
#include <vector> // std::vector #include <vector> // std::vector
#include <set> #include <set>
#include <gflags/gflags.h> // GetAllFlags #include <gflags/gflags.h> // GetAllFlags
// CommandLineFlagInfo // CommandLineFlagInfo
#include "butil/string_printf.h" #include "butil/string_printf.h"
#include "butil/string_splitter.h" #include "butil/string_splitter.h"
...@@ -89,7 +89,7 @@ static void PrintFlag(std::ostream& os, const GFLAGS_NS::CommandLineFlagInfo& fl ...@@ -89,7 +89,7 @@ static void PrintFlag(std::ostream& os, const GFLAGS_NS::CommandLineFlagInfo& fl
if (flag.default_value != flag.current_value) { if (flag.default_value != flag.current_value) {
os << " (default:" << (use_html ? os << " (default:" << (use_html ?
HtmlReplace(flag.default_value) : HtmlReplace(flag.default_value) :
flag.current_value) << ')'; flag.default_value) << ')';
} }
if (use_html) { if (use_html) {
os << "</span>"; os << "</span>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment