Mercurial > hg > TextShaper
comparison textshaper/main.py @ 36:55e0579e2143
STUB: textshaper/main.py textshaper/whitespace.py
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Sat, 03 May 2014 14:47:16 -0700 |
| parents | 88a69d587326 |
| children | 8cf9a26b9aaa |
comparison
equal
deleted
inserted
replaced
| 35:5ffa0dbcb7fe | 36:55e0579e2143 |
|---|---|
| 10 import subprocess | 10 import subprocess |
| 11 import sys | 11 import sys |
| 12 import time | 12 import time |
| 13 from .commands import Commands | 13 from .commands import Commands |
| 14 from .indent import deindent, indent | 14 from .indent import deindent, indent |
| 15 from .whitespace import underscore | |
| 15 from which import which | 16 from which import which |
| 16 | 17 |
| 17 HR = '--' | 18 HR = '--' |
| 18 | 19 |
| 19 def info(content): | 20 def info(content): |
| 37 def add_commands(): | 38 def add_commands(): |
| 38 # TODO: do this dynamically | 39 # TODO: do this dynamically |
| 39 commands = Commands() | 40 commands = Commands() |
| 40 commands.add(indent, 'i') | 41 commands.add(indent, 'i') |
| 41 commands.add(deindent, 'd') | 42 commands.add(deindent, 'd') |
| 43 commands.add(underscore, 'u') | |
| 42 return commands | 44 return commands |
| 45 | |
| 43 | 46 |
| 44 def add_options(parser): | 47 def add_options(parser): |
| 45 """add options to the parser instance""" | 48 """add options to the parser instance""" |
| 46 | 49 |
| 47 parser.add_argument('-f', '--file', dest='input', | 50 parser.add_argument('-f', '--file', dest='input', |
