summaryrefslogtreecommitdiff
path: root/absl/flags/parse.cc
diff options
context:
space:
mode:
authorGravatar Gennadiy Rozental <rogeeff@google.com>2023-02-27 12:18:10 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-02-27 12:19:03 -0800
commit0c1114c4fb83c844c7fd74708338cca1d3d9b0dc (patch)
tree70a30ff3e3860943201f2cf7f034509bddcde8fe /absl/flags/parse.cc
parent2d2801a315282e868d0695541d21f068cec22407 (diff)
Eliminate internal ArgvListAction enum.
PiperOrigin-RevId: 512697257 Change-Id: I828ac7a4ada482d60beba767ef9da6e2c0077c33
Diffstat (limited to 'absl/flags/parse.cc')
-rw-r--r--absl/flags/parse.cc15
1 files changed, 1 insertions, 14 deletions
diff --git a/absl/flags/parse.cc b/absl/flags/parse.cc
index 368248e3..768652d8 100644
--- a/absl/flags/parse.cc
+++ b/absl/flags/parse.cc
@@ -664,7 +664,6 @@ std::vector<std::string> GetMisspellingHints(const absl::string_view flag) {
// --------------------------------------------------------------------
std::vector<char*> ParseCommandLineImpl(int argc, char* argv[],
- ArgvListAction arg_list_act,
UsageFlagsAction usage_flag_act,
OnUndefinedFlag on_undef_flag) {
ABSL_INTERNAL_CHECK(argc > 0, "Missing argv[0]");
@@ -740,10 +739,6 @@ std::vector<char*> ParseCommandLineImpl(int argc, char* argv[],
continue;
}
- if (arg_from_argv && (arg_list_act == ArgvListAction::kKeepParsedArgs)) {
- output_args.push_back(argv[curr_list.FrontIndex()]);
- }
-
// 60. Split the current argument on '=' to figure out the argument
// name and value. If flag name is empty it means we've got "--". value
// can be empty either if there were no '=' in argument string at all or
@@ -784,18 +779,11 @@ std::vector<char*> ParseCommandLineImpl(int argc, char* argv[],
}
// 90. Deduce flag's value (from this or next argument)
- auto curr_index = curr_list.FrontIndex();
bool value_success = true;
std::tie(value_success, value) =
DeduceFlagValue(*flag, value, is_negative, is_empty_value, &curr_list);
success &= value_success;
- // If above call consumed an argument, it was a standalone value
- if (arg_from_argv && (arg_list_act == ArgvListAction::kKeepParsedArgs) &&
- (curr_index != curr_list.FrontIndex())) {
- output_args.push_back(argv[curr_list.FrontIndex()]);
- }
-
// 100. Set the located flag to a new new value, unless it is retired.
// Setting retired flag fails, but we ignoring it here while also reporting
// access to retired flag.
@@ -881,8 +869,7 @@ std::vector<char*> ParseCommandLineImpl(int argc, char* argv[],
std::vector<char*> ParseCommandLine(int argc, char* argv[]) {
return flags_internal::ParseCommandLineImpl(
- argc, argv, flags_internal::ArgvListAction::kRemoveParsedArgs,
- flags_internal::UsageFlagsAction::kHandleUsage,
+ argc, argv, flags_internal::UsageFlagsAction::kHandleUsage,
flags_internal::OnUndefinedFlag::kAbortIfUndefined);
}