diff options
author | Mike Ma <yanmin@google.com> | 2020-03-03 17:58:35 -0800 |
---|---|---|
committer | Mike Ma <yanmin@google.com> | 2020-03-05 12:42:50 -0800 |
commit | b6f7c4725253de798cd7487f671c66663614a158 (patch) | |
tree | 0c23162f1db918f57f51cd9feb56b13550bc55c0 /cmds/incident | |
parent | f7ed9bc589774fcc911321bae5c6521397e95aef (diff) |
Add an option to zip incident report
Incident reports are getting bigger as we add more sections. Add an
option (-z, default off) to zip incident report.
Bug: 150160547
Test: atest incidentd_test
Test: adb shell incident -z -p EXPLICIT | gunzip | ./out/soong/host/linux-x86/bin/aprotoc --decode=android.os.IncidentProto --proto_path=./ --proto_path=external/protobuf/src frameworks/base/core/proto/android/os/incident.proto
Change-Id: I7c8ff1d91df842c200462ee29f15feae68e62739
Diffstat (limited to 'cmds/incident')
-rw-r--r-- | cmds/incident/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmds/incident/main.cpp b/cmds/incident/main.cpp index eb2b98a666b9..cdf742dcf226 100644 --- a/cmds/incident/main.cpp +++ b/cmds/incident/main.cpp @@ -229,6 +229,7 @@ usage(FILE* out) fprintf(out, " -l list available sections\n"); fprintf(out, " -p privacy spec, LOCAL, EXPLICIT or AUTOMATIC. Default AUTOMATIC.\n"); fprintf(out, " -r REASON human readable description of why the report is taken.\n"); + fprintf(out, " -z gzip the incident report, i.e. pipe the output through gzip.\n"); fprintf(out, "\n"); fprintf(out, "and one of these destinations:\n"); fprintf(out, " -b (default) print the report to stdout (in proto format)\n"); @@ -253,7 +254,7 @@ main(int argc, char** argv) // Parse the args int opt; - while ((opt = getopt(argc, argv, "bhdlp:r:s:u")) != -1) { + while ((opt = getopt(argc, argv, "bhdlp:r:s:uz")) != -1) { switch (opt) { case 'h': usage(stdout); @@ -300,6 +301,9 @@ main(int argc, char** argv) destination = DEST_BROADCAST; receiverArg = optarg; break; + case 'z': + args.setGzip(true); + break; default: usage(stderr); return 1; |