From 244d3101478424cf6045e4eee2b4442443533c5f Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Wed, 18 Jul 2007 19:41:25 +0000 Subject: [PATCH] Add the missing "help " functionality in cmd (patch by Pierre Schweitzer, heis_spiter AT hotmail DOT com) I slightly modified the patch to include a terminating null character See issue #2406 for more details. svn path=/trunk/; revision=27722 --- reactos/base/shell/cmd/internal.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/reactos/base/shell/cmd/internal.c b/reactos/base/shell/cmd/internal.c index 8f26e18e133..7d25e24e1a8 100644 --- a/reactos/base/shell/cmd/internal.c +++ b/reactos/base/shell/cmd/internal.c @@ -127,11 +127,14 @@ * Remove all hard code string so they can be * translate to other langues. * - * 19-jul-2005 (Brandon Turner ) * Rewrite the CD, it working as Windows 2000 CMD * - * 19-jul-2005 (Magnus Olsen ) + * Add SetRootPath and GetRootPath + * + * 14-Jul-2007 (Pierre Schweitzer ) + * Added commands help display to help command (ex. : "help cmd") */ #include @@ -760,7 +763,20 @@ INT CommandShowCommands (LPTSTR cmd, LPTSTR param) INT CommandShowCommandsDetail (LPTSTR cmd, LPTSTR param) { - PrintCommandListDetail (); + /* If a param was send, display help of correspondent command */ + if (_tcslen(param)) + { + LPTSTR NewCommand = malloc((_tcslen(param)+4)*sizeof(TCHAR)); + _tcscpy(NewCommand, param); + _tcscat(NewCommand, _T(" /?\0")); + DoCommand(NewCommand); + free(NewCommand); + } + /* Else, display detailed commands list */ + else + { + PrintCommandListDetail (); + } return 0; }