diff --git a/cli/xxhsum.c b/cli/xxhsum.c index fb9c1b03..5ddbb8d6 100644 --- a/cli/xxhsum.c +++ b/cli/xxhsum.c @@ -426,6 +426,7 @@ static LineStatus XSUM_hashFile(const char* fileName, } inFile = XSUM_fopen( fileName, "rb" ); if (inFile==NULL) { + XSUM_log("Error: unable to open input\n"); return LineStatus_failedToOpen; } } @@ -1404,6 +1405,7 @@ static int XSUM_usage(const char* exename) XSUM_log( " -c, --check read xxHash checksum from [files] and check them \n"); XSUM_log( " --files-from generate hashes for files listed in [files] \n"); XSUM_log( " --filelist generate hashes for files listed in [files] \n"); + XSUM_log( " - forces stdin as input, even if it's the console \n"); XSUM_log( " -h, --help display a long help page about advanced options \n"); return 0; } @@ -1658,8 +1660,10 @@ XSUM_API int XSUM_main(int argc, const char* argv[]) } /* Check if input is defined as console; trigger an error in this case */ - if ( (filenamesStart==0) && XSUM_isConsole(stdin) && !explicitStdin) - return XSUM_badusage(exename); + if ( (filenamesStart==0) && XSUM_isConsole(stdin) && !explicitStdin) { + XSUM_log("No input provided \n"); + return 1; + } if (filenamesStart==0) filenamesStart = argc;