[NETSTAT] Fix output formats and more (#1709)

* [NETSTAT] Restore expected output formats

"Revert" parts of bd3c852012.

CORE-16119

* [NETSTAT] Improve default and ICMPv4 output formats

* [NETSTAT] Fix a few typos, in output strings

* [NETSTAT] Output usage to StdErr

* [NETSTAT] Be more explicit about unimplemented -b/-t/-v options
This commit is contained in:
Serge Gautherie 2019-11-29 08:26:19 +01:00 committed by Timo Kreuzer
parent 5734570a15
commit 1fa2780796
2 changed files with 69 additions and 59 deletions

View file

@ -8,7 +8,7 @@
/*
* TODO:
* sort function return values.
* implement -b, -o and -v
* implement -b, -t and -v
* clean up GetIpHostName
* command line parser needs more work
*/
@ -88,6 +88,8 @@ BOOL ParseCmdline(int argc, wchar_t* argv[])
bDoShowAllCons = TRUE;
break;
case L'b':
// UNIMPLEMENTED.
ConPuts(StdErr, L"'b' option is FIXME (Accepted option though unimplemented feature).\n");
bDoShowProcName = TRUE;
break;
case L'e':
@ -96,6 +98,9 @@ BOOL ParseCmdline(int argc, wchar_t* argv[])
case L'n':
bDoShowNumbers = TRUE;
break;
case L'o':
bDoShowProcessId = TRUE;
break;
case L'p':
bDoShowProtoCons = TRUE;
Proto = argv[i+1];
@ -109,7 +114,7 @@ BOOL ParseCmdline(int argc, wchar_t* argv[])
Protocol = UDP;
else
{
ConResPuts(StdOut, IDS_USAGE);
ConResPuts(StdErr, IDS_USAGE);
return FALSE;
}
break;
@ -119,16 +124,17 @@ BOOL ParseCmdline(int argc, wchar_t* argv[])
case L's':
bDoShowProtoStats = TRUE;
break;
case L'o':
bDoShowProcessId = TRUE;
case L't':
// UNIMPLEMENTED.
ConPuts(StdErr, L"'t' option is FIXME (Accepted option though unimplemented feature).\n");
break;
case L'v':
// FIXME!
ConPuts(StdOut, L"got v\n");
// UNIMPLEMENTED.
ConPuts(StdErr, L"'v' option is FIXME (Accepted option though unimplemented feature).\n");
bDoDispSeqComp = TRUE;
break;
default :
ConResPuts(StdOut, IDS_USAGE);
ConResPuts(StdErr, IDS_USAGE);
return FALSE;
}
}
@ -142,7 +148,7 @@ BOOL ParseCmdline(int argc, wchar_t* argv[])
}
// else
// {
// ConResPrintf(StdOut, IDS_USAGE);
// ConResPrintf(StdErr, IDS_USAGE);
// return FALSE;
// }
}
@ -169,6 +175,7 @@ BOOL DisplayOutput(VOID)
{
if (bNoOptions)
{
ConResPuts(StdOut, IDS_ACTIVE_CONNECT);
DisplayTableHeader();
return ShowTcpTable();
}