[NETSH] Print proper prompt

This commit is contained in:
Eric Kohl
2025-09-08 01:11:22 +02:00
parent 5d5e5d1a46
commit 1c1b8a2260

View File

@@ -220,6 +220,23 @@ InterpretScript(
}
VOID
PrintPrompt(
PCONTEXT_ENTRY pContext)
{
if (pContext == pRootContext)
{
ConPuts(StdOut, L"netsh");
}
else
{
PrintPrompt(pContext->pParentContext);
ConPuts(StdOut, L" ");
ConPuts(StdOut, pContext->pszContextName);
}
}
VOID
InterpretInteractive(VOID)
{
@@ -236,12 +253,7 @@ InterpretInteractive(VOID)
memset(args_vector, 0, sizeof(args_vector));
/* Shown just before the input where the user places commands */
ConPuts(StdOut, L"netsh");
if (pCurrentContext != pRootContext)
{
ConPuts(StdOut, L" ");
ConPuts(StdOut, pCurrentContext->pszContextName);
}
PrintPrompt(pCurrentContext);
ConPuts(StdOut, L">");
/* Get input from the user. */