Skip to content

Commit 9723245

Browse files
committed
[NETSH] Improve error message output
1 parent 2394172 commit 9723245

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

base/applications/network/netsh/interpreter.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,10 @@ InterpretCommand(
209209
if (dwError != ERROR_SUCCESS)
210210
{
211211
if (dwError == ERROR_SHOW_USAGE)
212+
{
212213
PrintCommandHelp(pTempContext, pGroup, pCommand);
213-
else
214-
ConPrintf(StdOut, L"Command: %s Error: %lu\n\n", pCommand->pwszCmdToken, dwError);
214+
dwError == ERROR_SUPPRESS_OUTPUT;
215+
}
215216
}
216217
else
217218
{
@@ -314,7 +315,7 @@ InterpretCommand(
314315
break;
315316

316317
case STATE_DONE:
317-
DPRINT("STATE_DONE\n");
318+
DPRINT("STATE_DONE dwError %ld\n", dwError);
318319
return dwError;
319320
}
320321
}
@@ -426,12 +427,14 @@ InterpretInteractive(VOID)
426427
}
427428

428429
dwError = InterpretCommand(args_vector, dwArgCount, &bDone);
429-
if (dwError == ERROR_CMD_NOT_FOUND)
430+
if ((dwError != ERROR_SUCCESS) && (dwError != ERROR_SUPPRESS_OUTPUT))
430431
{
431432
PWSTR pszCommandString = MergeStrings(args_vector, dwArgCount);
432433
PrintError(NULL, dwError, pszCommandString);
433434
HeapFree(GetProcessHeap(), 0, pszCommandString);
434435
}
436+
if (dwError != ERROR_SUPPRESS_OUTPUT)
437+
ConPuts(StdOut, L"\n");
435438

436439
if (bDone)
437440
break;

0 commit comments

Comments
 (0)