mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
When ‘--help’ is given, just run ‘man’ to show the manual page
I.e. do what git does. I'm too lazy to keep the builtin help text up to date :-) Also add ‘--help’ to various commands that lacked it (e.g. nix-collect-garbage).
This commit is contained in:
parent
9c41c66c5b
commit
a562d544d8
25 changed files with 51 additions and 329 deletions
|
@ -91,6 +91,7 @@ string getArg(const string & opt,
|
|||
return *i;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize and reorder arguments, then call the actual argument
|
||||
processor. */
|
||||
static void initAndRun(int argc, char * * argv)
|
||||
|
@ -275,6 +276,14 @@ static void * oomHandler(size_t requested)
|
|||
}
|
||||
|
||||
|
||||
void showManPage(const string & name)
|
||||
{
|
||||
string cmd = "man " + name;
|
||||
if (system(cmd.c_str()) != 0)
|
||||
throw Error(format("command `%1%' failed") % cmd);
|
||||
}
|
||||
|
||||
|
||||
int exitCode = 0;
|
||||
char * * argvSaved = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue