mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
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:
parent
9ae84426d9
commit
b5df2a2aa5
2 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue