4 /* user defined headers */
5 #include <common-cmds.h>
8 #include <kvm/kvm-cmd.h>
9 #include <kvm/builtin-help.h>
12 const char kvm_usage_string
[] =
15 const char kvm_more_info_string
[] =
16 "See 'kvm help COMMAND' for more information on a specific command.";
19 static void list_common_cmds_help(void)
21 unsigned int i
, longest
= 0;
23 for (i
= 0; i
< ARRAY_SIZE(common_cmds
); i
++) {
24 if (longest
< strlen(common_cmds
[i
].name
))
25 longest
= strlen(common_cmds
[i
].name
);
28 puts(" The most commonly used kvm commands are:");
29 for (i
= 0; i
< ARRAY_SIZE(common_cmds
); i
++) {
30 printf(" %-*s ", longest
, common_cmds
[i
].name
);
31 puts(common_cmds
[i
].help
);
35 static void kvm_help(void)
37 printf("\n usage: %s\n\n", kvm_usage_string
);
38 list_common_cmds_help();
39 printf("\n %s\n\n", kvm_more_info_string
);
43 static void help_cmd(const char *cmd
)
46 p
= kvm_get_command(kvm_commands
, cmd
);
53 int kvm_cmd_help(int argc
, const char **argv
, const char *prefix
)
55 if (!argv
|| !*argv
) {