help 260 B

123456789101112131415161718
  1. #!/bin/bash
  2. set -e
  3. cd $(dirname $0)
  4. echo Targets:
  5. for i in *; do
  6. if [ ! -x $i ] || [ ! -f $i ]; then
  7. continue
  8. fi
  9. MSG=$(grep '^# help:' $i)
  10. if [ -n "$MSG" ]; then
  11. echo " " ${i}: $(echo $MSG | sed 's/# help://')
  12. fi
  13. done