File: make-help.py

package info (click to toggle)
python-cloup 3.0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 936 kB
  • sloc: python: 5,371; makefile: 120
file content (10 lines) | stat: -rw-r--r-- 221 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
import re
import sys

regex = re.compile(r'^([a-zA-Z_-]+):.*?## (.*)$')

for line in sys.stdin:
    match = regex.match(line)
    if match:
        target, help = match.groups()
        print("%-20s %s" % (target, help))