ReactOS  0.4.14-dev-77-gd9e7c48
help.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS DiskPart
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: base/system/diskpart/help.c
5  * PURPOSE: Manages all the partitions of the OS in an interactive way.
6  * PROGRAMMERS: Lee Schroeder
7  */
8 
9 #include "diskpart.h"
10 
11 /*
12  * help_cmdlist():
13  * shows all the available commands and basic descriptions for diskpart
14  */
16 {
17  PCOMMAND cmdptr;
18 
19  /* Print the header information */
21  ConPuts(StdOut, L"\n");
22 
23  /* List all the commands and the basic descriptions */
24  for (cmdptr = cmds; cmdptr->name; cmdptr++)
25  ConResPuts(StdOut, cmdptr->help_desc);
26 
27  ConPuts(StdOut, L"\n");
28 }
29 
30 /* help_main(char *arg):
31  * main entry point for the help command. Gives help to users who needs it.
32  */
34 {
35  PCOMMAND cmdptr;
36 
37  if (argc == 1)
38  {
39  help_cmdlist();
40  return TRUE;
41  }
42 
43  /* Scan internal command table */
44  for (cmdptr = cmds; cmdptr->name; cmdptr++)
45  {
46  if (_wcsicmp(argv[1], cmdptr->name) == 0)
47  {
48  ConResPuts(StdOut, cmdptr->help);
49  return TRUE;
50  }
51  }
52 
53  help_cmdlist();
54 
55  return TRUE;
56 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
COMMAND cmds[]
Definition: main.c:21
BOOL help_main(INT argc, LPWSTR *argv)
Definition: help.c:33
VOID help_cmdlist(VOID)
Definition: help.c:15
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:56
INT help_desc
Definition: diskpart.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
INT help
Definition: diskpart.h:55
INT ConResPuts(IN PCON_STREAM Stream, IN UINT uID)
Definition: outstream.c:610
static const WCHAR L[]
Definition: oid.c:1250
INT ConPuts(IN PCON_STREAM Stream, IN LPWSTR szStr)
Definition: outstream.c:427
#define IDS_APP_HEADER
Definition: resource.h:13
#define StdOut
Definition: stream.h:76
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: main.c:14
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
WCHAR * name
Definition: main.c:16