]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libxcmd/help.c
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2003-2005 Silicon Graphics, Inc.
7 #include "platform_defs.h"
9 #include "../quota/init.h"
11 static cmdinfo_t help_cmd
;
12 static void help_onecmd(const char *cmd
, const cmdinfo_t
*ct
);
13 static void help_oneline(const char *cmd
, const cmdinfo_t
*ct
);
20 for (ct
= cmdtab
; ct
< &cmdtab
[ncmds
]; ct
++)
21 help_oneline(ct
->name
, ct
);
22 printf(_("\nUse 'help commandname' for extended help.\n"));
36 ct
= find_command(argv
[1]);
38 printf(_("command %s not found\n"), argv
[1]);
41 help_onecmd(argv
[1], ct
);
50 help_oneline(cmd
, ct
);
63 printf("%s ", ct
->name
);
65 printf("(or %s) ", ct
->altname
);
68 printf("%s ", ct
->args
);
69 printf("-- %s\n", ct
->oneline
);
75 help_cmd
.name
= "help";
76 help_cmd
.altname
= "?";
77 help_cmd
.cfunc
= help_f
;
80 help_cmd
.flags
= CMD_FLAG_ONESHOT
| CMD_FLAG_LIBRARY
;
81 help_cmd
.args
= _("[command]");
82 help_cmd
.oneline
= _("help for one or all commands");
84 add_command(&help_cmd
);