mirror of
https://github.com/reactos/reactos.git
synced 2026-06-20 01:27:19 +08:00
[NETSH] Print the commands help text if a command returns ERROR_SHOW_USAGE
This commit is contained in:
@@ -339,7 +339,7 @@ ExecCommand(
|
||||
DPRINT("ExecCommand()\n");
|
||||
|
||||
if (dwArgCount - dwCurrentIndex != 1)
|
||||
return ERROR_INVALID_SYNTAX;
|
||||
return ERROR_SHOW_USAGE;
|
||||
|
||||
return RunScript(argv[dwCurrentIndex]);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,10 @@ InterpretCommand(
|
||||
dwError = pCommand->pfnCmdHandler(NULL, argv, dwArgIndex, dwArgCount, 0, NULL, bDone);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
ConPrintf(StdOut, L"Commnand: %S Error: %lu\n\n", pCommand->pwszCmdToken, dwError);
|
||||
if (dwError == ERROR_SHOW_USAGE)
|
||||
PrintCommandHelp(pTempContext, pCommand);
|
||||
else
|
||||
ConPrintf(StdOut, L"Commnand: %S Error: %lu\n\n", pCommand->pwszCmdToken, dwError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user