diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | INSTALL.md | 11 | ||||
m--------- | doc | 11 | ||||
-rw-r--r-- | src/gflags.cc | 3 | ||||
-rw-r--r-- | src/gflags_completions.cc | 7 | ||||
-rw-r--r-- | src/gflags_reporting.cc | 10 |
6 files changed, 24 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5aa9f07..82c540d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,6 +407,9 @@ if (NOT GFLAGS_IS_SUBPROJECT) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib") set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "lib") endif () +# Set postfixes for generated libraries based on buildtype. +set(CMAKE_RELEASE_POSTFIX "") +set(CMAKE_DEBUG_POSTFIX "_debug") # ---------------------------------------------------------------------------- # installation directories @@ -78,11 +78,6 @@ your WORKSPACE file: remote = "https://github.com/gflags/gflags.git", ) - bind( - name = "gflags", - actual = "@com_github_gflags_gflags//:gflags", - ) - -You can then add `//external:gflags` to the `deps` section of a `cc_binary` or -`cc_library` rule, and `#include <gflags/gflags.h>` to include it in your source -code. +You can then add `@com_github_gflags_gflags//:gflags` to the `deps` section of a +`cc_binary` or `cc_library` rule, and `#include <gflags/gflags.h>` to include it +in your source code. diff --git a/doc b/doc -Subproject 971dd2a4fadac9cdab174c523c22df79efd63aa +Subproject 679df49798e2d9766975399baf063446e0957bb diff --git a/src/gflags.cc b/src/gflags.cc index 9869782..504b722 100644 --- a/src/gflags.cc +++ b/src/gflags.cc @@ -1036,8 +1036,7 @@ uint32 CommandLineFlagParser::ParseNewCommandLineFlags(int* argc, char*** argv, char* arg = (*argv)[i]; // Like getopt(), we permute non-option flags to be at the end. - if (arg[0] != '-' || // must be a program argument - (arg[0] == '-' && arg[1] == '\0')) { // "-" is an argument, not a flag + if (arg[0] != '-' || arg[1] == '\0') { // must be a program argument "-" is an argument, not a flag memmove((*argv) + i, (*argv) + i+1, (*argc - (i+1)) * sizeof((*argv)[i])); (*argv)[*argc-1] = arg; // we go last first_nonopt--; // we've been pushed onto the stack diff --git a/src/gflags_completions.cc b/src/gflags_completions.cc index f772486..4afc521 100644 --- a/src/gflags_completions.cc +++ b/src/gflags_completions.cc @@ -179,6 +179,11 @@ struct CompletionOptions { bool flag_description_substring_search; bool return_all_matching_flags; bool force_no_update; + CompletionOptions(): flag_name_substring_search(false), + flag_location_substring_search(false), + flag_description_substring_search(false), + return_all_matching_flags(false), + force_no_update(false) { } }; // Notable flags are flags that are special or preferred for some @@ -202,7 +207,7 @@ struct NotableFlags { static void PrintFlagCompletionInfo(void) { string cursor_word = FLAGS_tab_completion_word; string canonical_token; - CompletionOptions options = { }; + CompletionOptions options = CompletionOptions(); CanonicalizeCursorWordAndSearchOptions( cursor_word, &canonical_token, diff --git a/src/gflags_reporting.cc b/src/gflags_reporting.cc index 7cc6691..29be922 100644 --- a/src/gflags_reporting.cc +++ b/src/gflags_reporting.cc @@ -296,10 +296,10 @@ static void ShowUsageWithFlagsMatching(const char *argv0, } } -void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict) { +void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict_) { vector<string> substrings; - if (restrict != NULL && *restrict != '\0') { - substrings.push_back(restrict); + if (restrict_ != NULL && *restrict_ != '\0') { + substrings.push_back(restrict_); } ShowUsageWithFlagsMatching(argv0, substrings); } @@ -389,8 +389,8 @@ void HandleCommandLineHelpFlags() { gflags_exitfunc(1); } else if (!FLAGS_helpon.empty()) { - string restrict = PATH_SEPARATOR + FLAGS_helpon + "."; - ShowUsageWithFlagsRestrict(progname, restrict.c_str()); + string restrict_ = PATH_SEPARATOR + FLAGS_helpon + "."; + ShowUsageWithFlagsRestrict(progname, restrict_.c_str()); gflags_exitfunc(1); } else if (!FLAGS_helpmatch.empty()) { |