Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: webrtc/logging/rtc_event_log/rtc_event_log2stats.cc

Issue 3005483002: Replace remaining gflags usages with rtc_base/flags (Closed)
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/logging/rtc_event_log/rtc_event_log2stats.cc
diff --git a/webrtc/logging/rtc_event_log/rtc_event_log2stats.cc b/webrtc/logging/rtc_event_log/rtc_event_log2stats.cc
index 6b21cf1a7ee50a2e15263f1540aacdb5e7388144..36fa1e34fb7c2c554d4910a963c5eea61ae0c0d7 100644
--- a/webrtc/logging/rtc_event_log/rtc_event_log2stats.cc
+++ b/webrtc/logging/rtc_event_log/rtc_event_log2stats.cc
@@ -19,9 +19,9 @@
#include <utility>
#include <vector>
-#include "gflags/gflags.h"
#include "webrtc/logging/rtc_event_log/rtc_event_log.h"
#include "webrtc/rtc_base/checks.h"
+#include "webrtc/rtc_base/flags.h"
#include "webrtc/rtc_base/ignore_wundef.h"
#include "webrtc/rtc_base/logging.h"
@@ -36,6 +36,8 @@ RTC_POP_IGNORING_WUNDEF()
namespace {
+DEFINE_bool(help, false, "Prints this message.");
+
struct Stats {
int count = 0;
size_t total_size = 0;
@@ -176,15 +178,17 @@ int main(int argc, char* argv[]) {
"Tool for file usage statistics from an RtcEventLog.\n"
"Run " +
program_name +
- " --helpshort for usage.\n"
+ " --help for usage.\n"
"Example usage:\n" +
program_name + " input.rel\n";
- google::SetUsageMessage(usage);
- google::ParseCommandLineFlags(&argc, &argv, true);
-
- if (argc != 2) {
- std::cout << google::ProgramUsage();
- return 0;
+ if (rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true) ||
+ FLAG_help || argc != 2) {
+ std::cout << usage;
+ if (FLAG_help) {
+ rtc::FlagList::Print(nullptr, false);
+ return 0;
+ }
+ return 1;
}
std::string file_name = argv[1];
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log2rtp_dump.cc ('k') | webrtc/logging/rtc_event_log/rtc_event_log2text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698