CmdHelp: Return error if man command fails

I feel this is expected behavior, but also eliminates the following compile time
warning on one of my systems:

  warning: ignoring return value of ‘int system(const char*)’, declared with
    attribute warn_unused_result [-Wunused-result]

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This commit is contained in:
Shaun Ruffell 2020-02-23 23:52:30 -06:00 committed by lauft
parent 9ae84426d9
commit b5df2a2aa5
2 changed files with 3 additions and 3 deletions

View file

@ -117,8 +117,8 @@ int CmdHelp (
if (! words.empty ())
{
std::string man_command = "man timew-" + words[0];
system (man_command.c_str());
return 0;
int ret = system (man_command.c_str());
return (WIFEXITED (ret)) ? WEXITSTATUS (ret) : -1;
}
return CmdHelpUsage (extensions);