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

Unified Diff: chrome/app/chrome_dll_main.cc

Issue 160026: linux: show the manpage on -h or --help (Closed)
Patch Set: bikeshed Created 11 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_dll_main.cc
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 52a933495d5a10a3d9c78bbd68b63053e266e76e..652217e40d6bd96787b6a10f7a4ffa1af74835b5 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -338,6 +338,16 @@ int ChromeMain(int argc, const char** argv) {
return 1;
#endif
+#if defined(OS_LINUX)
+ // Show the man page on --help or -h.
+ if (parsed_command_line.HasSwitch(L"help") ||
+ parsed_command_line.HasSwitch(L"h")) {
+ FilePath binary(parsed_command_line.argv()[0]);
+ int ret = execlp("man", "man", binary.BaseName().value().c_str(), NULL);
+ LOG(FATAL) << "execlp failed: " << strerror(ret);
+ }
+#endif
+
#if defined(OS_POSIX)
// Always ignore SIGPIPE. We check the return value of write().
CHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698