Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. help.c
  5. Abstract:
  6. This module implements the help system.
  7. Author:
  8. Wesley Witt (wesw) 21-Oct-1998
  9. Revision History:
  10. --*/
  11. #include "cmdcons.h"
  12. #pragma hdrstop
  13. BOOLEAN
  14. RcCmdParseHelp(
  15. IN PTOKENIZED_LINE TokenizedLine,
  16. ULONG MsgId
  17. )
  18. {
  19. BOOL doHelp = FALSE;
  20. PLINE_TOKEN Token;
  21. LPCWSTR Arg;
  22. if (TokenizedLine == NULL || TokenizedLine->Tokens == NULL ||
  23. TokenizedLine->Tokens->Next == NULL)
  24. {
  25. return FALSE;
  26. }
  27. // check for help
  28. Token = TokenizedLine->Tokens->Next;
  29. while(Token) {
  30. Arg = Token->String;
  31. if ((Arg[0] == L'/' || Arg[0] == L'-') && (Arg[1] == L'?' || Arg[1] == L'h' || Arg[1] == L'H')) {
  32. doHelp = TRUE;
  33. break;
  34. }
  35. Token = Token->Next;
  36. }
  37. if (doHelp) {
  38. //
  39. // Enable more mode since the help text can be quile long sometimes
  40. //
  41. pRcEnableMoreMode();
  42. RcMessageOut( MsgId );
  43. pRcDisableMoreMode();
  44. return TRUE;
  45. }
  46. return FALSE;
  47. }
  48. ULONG
  49. RcCmdHelpHelp(
  50. IN PTOKENIZED_LINE TokenizedLine
  51. )
  52. {
  53. pRcEnableMoreMode();
  54. RcMessageOut( MSG_HELPCOMMAND_HELP );
  55. pRcDisableMoreMode();
  56. return TRUE;
  57. }