generate-cmdlist.sh 447 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh

echo "/* Automatically generated by $0 */
struct cmdname_help
{
    char name[16];
    char help[80];
};

static struct cmdname_help common_cmds[] = {"

I
Ingo Molnar 已提交
12
sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
13 14 15 16
sort |
while read cmd
do
     sed -n '
I
Ingo Molnar 已提交
17
     /^NAME/,/perf-'"$cmd"'/H
18 19
     ${
            x
I
Ingo Molnar 已提交
20
            s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
21
	    p
I
Ingo Molnar 已提交
22
     }' "Documentation/perf-$cmd.txt"
23 24
done
echo "};"