summaryrefslogtreecommitdiff
path: root/cmds/idmap2/libidmap2/CommandLineOptions.cpp
diff options
context:
space:
mode:
authorSteven Laver <lavers@google.com>2019-01-20 16:40:46 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-20 16:40:46 +0000
commitc470daee1cf372142e66d4786f98b157f284dacb (patch)
treec118879b496f19919078294bd68a7867dc7e5d0f /cmds/idmap2/libidmap2/CommandLineOptions.cpp
parentbe058067720e1688137c15e68d5c4e50c4d66904 (diff)
parent67924d836712134f300f2952dad900daa5f3c98d (diff)
Merge changes from topic "QP1A.190107.001" into q-keystone-qcom-dev
* changes: Clear verification completed flag if an optional verifier is used telephony: hide added members in DisconnectCause location: fix build errors Update CarrierIdentifier constructors to match public API signature remove duplicate 'data_connection_5g' Move persist.debug.trace handling to frameworks Merge QP1A.190107.001
Diffstat (limited to 'cmds/idmap2/libidmap2/CommandLineOptions.cpp')
-rw-r--r--cmds/idmap2/libidmap2/CommandLineOptions.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmds/idmap2/libidmap2/CommandLineOptions.cpp b/cmds/idmap2/libidmap2/CommandLineOptions.cpp
index 28c3797226e1..cabc8f398c46 100644
--- a/cmds/idmap2/libidmap2/CommandLineOptions.cpp
+++ b/cmds/idmap2/libidmap2/CommandLineOptions.cpp
@@ -26,13 +26,11 @@
#include "idmap2/CommandLineOptions.h"
-namespace android {
-namespace idmap2 {
+namespace android::idmap2 {
std::unique_ptr<std::vector<std::string>> CommandLineOptions::ConvertArgvToVector(
int argc, const char** argv) {
- return std::unique_ptr<std::vector<std::string>>(
- new std::vector<std::string>(argv + 1, argv + argc));
+ return std::make_unique<std::vector<std::string>>(argv + 1, argv + argc);
}
CommandLineOptions& CommandLineOptions::OptionalFlag(const std::string& name,
@@ -111,8 +109,8 @@ bool CommandLineOptions::Parse(const std::vector<std::string>& argv, std::ostrea
}
if (!mandatory_opts.empty()) {
- for (auto iter = mandatory_opts.cbegin(); iter != mandatory_opts.cend(); ++iter) {
- outError << "error: " << *iter << ": missing mandatory option" << std::endl;
+ for (const auto& opt : mandatory_opts) {
+ outError << "error: " << opt << ": missing mandatory option" << std::endl;
}
Usage(outError);
return false;
@@ -159,5 +157,4 @@ void CommandLineOptions::Usage(std::ostream& out) const {
}
}
-} // namespace idmap2
-} // namespace android
+} // namespace android::idmap2