xref: /kvmtool/util/generate-cmdlist.sh (revision 26a3a071bb9dada378b9b395393e16fc3e69914d)
1#!/bin/sh
2
3echo "/* Automatically generated by $0 */
4struct cmdname_help
5{
6    char name[16];
7    char help[80];
8};
9
10static struct cmdname_help common_cmds[] = {"
11
12sed -n 's/^lkvm-\([^ \t]*\).*common/\1/p' command-list.txt |
13while read cmd
14do
15	 # TODO following sed command should be fixed
16     sed -n '/^NAME/,/^lkvm-'"$cmd"'/ {
17		 /NAME/d
18		 /--/d
19		 s/.*kvm-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
20	     p
21	 }' "Documentation/kvm-$cmd.txt"
22done
23echo "};"
24