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

Side by Side Diff: tools/catch_exception_tool.cc

Issue 774763006: tools: Use hyphens instead of underscores for multi-word option names (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « tools/catch_exception_tool.ad ('k') | tools/exception_port_tool.ad » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 const std::string& me_; 163 const std::string& me_;
164 int* exceptions_handled_; 164 int* exceptions_handled_;
165 }; 165 };
166 166
167 void Usage(const std::string& me) { 167 void Usage(const std::string& me) {
168 fprintf(stderr, 168 fprintf(stderr,
169 "Usage: %s -m SERVICE [OPTION]...\n" 169 "Usage: %s -m SERVICE [OPTION]...\n"
170 "Catch Mach exceptions and display information about them.\n" 170 "Catch Mach exceptions and display information about them.\n"
171 "\n" 171 "\n"
172 " -f, --file=FILE append information to FILE instead of stdout\n" 172 " -f, --file=FILE append information to FILE instead of stdout\n"
173 " -m, --mach_service=SERVICE register SERVICE with the bootstrap server\n" 173 " -m, --mach-service=SERVICE register SERVICE with the bootstrap server\n"
174 " -n, --nonblocking don't block waiting for an exception to occur\n" 174 " -n, --nonblocking don't block waiting for an exception to occur\n"
175 " -p, --persistent continue processing exceptions after the first\n" 175 " -p, --persistent continue processing exceptions after the first\n"
176 " -t, --timeout=TIMEOUT run for a maximum of TIMEOUT seconds\n" 176 " -t, --timeout=TIMEOUT run for a maximum of TIMEOUT seconds\n"
177 " --help display this help and exit\n" 177 " --help display this help and exit\n"
178 " --version output version information and exit\n", 178 " --version output version information and exit\n",
179 me.c_str()); 179 me.c_str());
180 ToolSupport::UsageTail(me); 180 ToolSupport::UsageTail(me);
181 } 181 }
182 182
183 int CatchExceptionToolMain(int argc, char* argv[]) { 183 int CatchExceptionToolMain(int argc, char* argv[]) {
(...skipping 12 matching lines...) Expand all
196 196
197 // Standard options. 197 // Standard options.
198 kOptionHelp = -2, 198 kOptionHelp = -2,
199 kOptionVersion = -3, 199 kOptionVersion = -3,
200 }; 200 };
201 201
202 Options options = {}; 202 Options options = {};
203 203
204 const struct option long_options[] = { 204 const struct option long_options[] = {
205 {"file", required_argument, nullptr, kOptionFile}, 205 {"file", required_argument, nullptr, kOptionFile},
206 {"mach_service", required_argument, nullptr, kOptionMachService}, 206 {"mach-service", required_argument, nullptr, kOptionMachService},
207 {"nonblocking", no_argument, nullptr, kOptionNonblocking}, 207 {"nonblocking", no_argument, nullptr, kOptionNonblocking},
208 {"persistent", no_argument, nullptr, kOptionPersistent}, 208 {"persistent", no_argument, nullptr, kOptionPersistent},
209 {"timeout", required_argument, nullptr, kOptionTimeout}, 209 {"timeout", required_argument, nullptr, kOptionTimeout},
210 {"help", no_argument, nullptr, kOptionHelp}, 210 {"help", no_argument, nullptr, kOptionHelp},
211 {"version", no_argument, nullptr, kOptionVersion}, 211 {"version", no_argument, nullptr, kOptionVersion},
212 {nullptr, 0, nullptr, 0}, 212 {nullptr, 0, nullptr, 0},
213 }; 213 };
214 214
215 int opt; 215 int opt;
216 while ((opt = getopt_long(argc, argv, "f:m:npt:", long_options, nullptr)) != 216 while ((opt = getopt_long(argc, argv, "f:m:npt:", long_options, nullptr)) !=
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 return EXIT_SUCCESS; 309 return EXIT_SUCCESS;
310 } 310 }
311 311
312 } // namespace 312 } // namespace
313 } // namespace crashpad 313 } // namespace crashpad
314 314
315 int main(int argc, char* argv[]) { 315 int main(int argc, char* argv[]) {
316 return crashpad::CatchExceptionToolMain(argc, argv); 316 return crashpad::CatchExceptionToolMain(argc, argv);
317 } 317 }
OLDNEW
« no previous file with comments | « tools/catch_exception_tool.ad ('k') | tools/exception_port_tool.ad » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698