We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55e4879 commit 60fac4fCopy full SHA for 60fac4f
1 file changed
textile/__main__.py
@@ -13,12 +13,18 @@ def main():
13
'accepts input as a file or stdin and can write out to '
14
'a file or stdout.')
15
parser = argparse.ArgumentParser(prog=prog, description=description)
16
+ parser.add_argument('-v', '--version', action='store_true',
17
+ help='show the version number and exit')
18
parser.add_argument('infile', nargs='?', type=argparse.FileType(),
19
help='a textile file to be converted')
20
parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'),
21
help='write the output of infile to outfile')
22
options = parser.parse_args()
23
24
+ if options.version:
25
+ print(textile.VERSION)
26
+ sys.exit()
27
+
28
infile = options.infile or sys.stdin
29
outfile = options.outfile or sys.stdout
30
with infile:
0 commit comments