generate-cmdlist.sh 447 B

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