diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 21:43:22 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 21:43:22 +0000 |
commit | b210e870c99e028d5c6ad8d26efe60dbd14c43c2 (patch) | |
tree | b4098dcbd9bc3fa7104732ca43c1b512507d7262 /chrome/app | |
parent | 8c219de64ead6e22ab58c170fb997b1052c7002f (diff) | |
download | chromium_src-b210e870c99e028d5c6ad8d26efe60dbd14c43c2.zip chromium_src-b210e870c99e028d5c6ad8d26efe60dbd14c43c2.tar.gz chromium_src-b210e870c99e028d5c6ad8d26efe60dbd14c43c2.tar.bz2 |
linux: show the manpage on -h or --help
Review URL: http://codereview.chromium.org/160026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 52a9334..652217e 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); |