[FSUTIL]
[reactos.git] / reactos / base / applications / cmdutils / fsutil / fsutil.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS FS utility tool
4 * FILE: base/applications/cmdutils/fsutil.c
5 * PURPOSE: FSutil main
6 * PROGRAMMERS: Pierre Schweitzer <pierre@reactos.org>
7 */
8
9 #include "fsutil.h"
10
11 /* Add handlers here for commands */
12 int DirtyMain(int argc, const TCHAR *argv[]);
13 static HandlerItem HandlersList[] =
14 {
15 /* Proc, name, help */
16 { DirtyMain, _T("dirty"), _T("Manipulates the dirty bit") },
17 };
18
19 static void
20 PrintUsage(const TCHAR * Command)
21 {
22 int i;
23
24 /* If we were given a command, print it's not supported */
25 if (Command != NULL)
26 {
27 _ftprintf(stderr, _T("Unhandled command: %s\n"), Command);
28 }
29
30 /* And dump any available command */
31 _ftprintf(stderr, _T("---- Handled commands ----\n\n"));
32 for (i = 0; i < (sizeof(HandlersList) / sizeof(HandlersList[0])); ++i)
33 {
34 _ftprintf(stderr, _T("%s\t%s\n"), HandlersList[i].Command, HandlersList[i].Desc);
35 }
36 }
37
38 int
39 __cdecl
40 _tmain(int argc, const TCHAR *argv[])
41 {
42 return FindHandler(argc, argv, (HandlerItem *)&HandlersList,
43 (sizeof(HandlersList) / sizeof(HandlersList[0])),
44 PrintUsage);
45 }