[ros-diffs] [cfinck] 27722: Add the missing "help <command>" 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.
cfinck at svn.reactos.org
cfinck at svn.reactos.org
Wed Jul 18 21:41:25 CEST 2007
Author: cfinck
Date: Wed Jul 18 23:41:25 2007
New Revision: 27722
URL: http://svn.reactos.org/svn/reactos?rev=27722&view=rev
Log:
Add the missing "help <command>" 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.
Modified:
trunk/reactos/base/shell/cmd/internal.c
Modified: trunk/reactos/base/shell/cmd/internal.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/internal.c?rev=27722&r1=27721&r2=27722&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/internal.c (original)
+++ trunk/reactos/base/shell/cmd/internal.c Wed Jul 18 23:41:25 2007
@@ -127,11 +127,14 @@
* Remove all hard code string so they can be
* translate to other langues.
*
- * 19-jul-2005 (Brandon Turner <turnerb7 at msu.edu)
+ * 19-Jul-2005 (Brandon Turner <turnerb7 at msu.edu>)
* Rewrite the CD, it working as Windows 2000 CMD
*
- * 19-jul-2005 (Magnus Olsen <magnus at greatlord.com)
- * Add SetRootPath and GetRootPath
+ * 19-Jul-2005 (Magnus Olsen <magnus at greatlord.com>)
+ * Add SetRootPath and GetRootPath
+ *
+ * 14-Jul-2007 (Pierre Schweitzer <heis_spiter at hotmail.com>)
+ * Added commands help display to help command (ex. : "help cmd")
*/
#include <precomp.h>
@@ -760,7 +763,20 @@
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;
}
More information about the Ros-diffs
mailing list