• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2
3PREFIX="$1"
4
5echo "/* Automatically generated by $0 */
6struct cmdname_help
7{
8    char name[16];
9    char help[80];
10};
11
12static struct cmdname_help common_cmds[] = {"
13
14sed -n -e 's/^perf-\([^ 	]*\)[ 	].* common.*/\1/p' ${PREFIX}/command-list.txt |
15sort |
16while read cmd
17do
18     sed -n '
19     /^NAME/,/perf-'"$cmd"'/H
20     ${
21            x
22            s/.*perf-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
23	    p
24     }' "${PREFIX}/Documentation/perf-$cmd.txt"
25done
26echo "};"
27