1 #!/bin/sh 2 3 PREFIX="$1" 4 5 echo "/* Automatically generated by $0 */ 6 struct cmdname_help 7 { 8 char name[16]; 9 char help[80]; 10 }; 11 12 static struct cmdname_help common_cmds[] = {" 13 14 sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' ${PREFIX}/command-list.txt | 15 sort | 16 while read cmd 17 do 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" 25 done 26 echo "};" 27