diff options
Diffstat (limited to 'absl/flags/internal/parse.h')
-rw-r--r-- | absl/flags/internal/parse.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/absl/flags/internal/parse.h b/absl/flags/internal/parse.h index e4352049..10c531b8 100644 --- a/absl/flags/internal/parse.h +++ b/absl/flags/internal/parse.h @@ -16,6 +16,8 @@ #ifndef ABSL_FLAGS_INTERNAL_PARSE_H_ #define ABSL_FLAGS_INTERNAL_PARSE_H_ +#include <iostream> +#include <ostream> #include <string> #include <vector> @@ -40,9 +42,15 @@ enum class OnUndefinedFlag { kAbortIfUndefined }; -std::vector<char*> ParseCommandLineImpl(int argc, char* argv[], - UsageFlagsAction usage_flag_action, - OnUndefinedFlag undef_flag_action); +// This is not a public interface. This interface exists to expose the ability +// to change help output stream in case of parsing errors. This is used by +// internal unit tests to validate expected outputs. +// When this was written, `EXPECT_EXIT` only supported matchers on stderr, +// but not on stdout. +std::vector<char*> ParseCommandLineImpl( + int argc, char* argv[], UsageFlagsAction usage_flag_action, + OnUndefinedFlag undef_flag_action, + std::ostream& error_help_output = std::cout); // -------------------------------------------------------------------- // Inspect original command line |