Improve tempeditor docstring.
This commit is contained in:
parent
1c70619df0
commit
0722514c47
1 changed files with 14 additions and 2 deletions
|
@ -1,8 +1,20 @@
|
||||||
'''
|
'''
|
||||||
|
tempeditor
|
||||||
|
==========
|
||||||
|
|
||||||
This program allows you to use your preferred text editor as an intermediate
|
This program allows you to use your preferred text editor as an intermediate
|
||||||
step in a processing pipeline. The user will use the text editor to edit a temp
|
step in a processing pipeline. The user will use the text editor to edit a temp
|
||||||
file, and when they close the editor the contents of the temp file will be sent
|
file, and when they close the editor the contents of the temp file will be sent
|
||||||
to stdout.
|
to stdout.
|
||||||
|
|
||||||
|
Command line usage:
|
||||||
|
|
||||||
|
> tempeditor [--text X]
|
||||||
|
|
||||||
|
--text X:
|
||||||
|
The initial text in the document.
|
||||||
|
Uses pipeable to support !c clipboard, !i stdin.
|
||||||
|
If not provided, the user starts with a blank document.
|
||||||
'''
|
'''
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
@ -11,6 +23,7 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from voussoirkit import betterhelp
|
||||||
from voussoirkit import pipeable
|
from voussoirkit import pipeable
|
||||||
from voussoirkit import subproctools
|
from voussoirkit import subproctools
|
||||||
from voussoirkit import winwhich
|
from voussoirkit import winwhich
|
||||||
|
@ -74,8 +87,7 @@ def main(argv):
|
||||||
parser.add_argument('--text', dest='initial_text', default=None)
|
parser.add_argument('--text', dest='initial_text', default=None)
|
||||||
parser.set_defaults(func=tempeditor_argparse)
|
parser.set_defaults(func=tempeditor_argparse)
|
||||||
|
|
||||||
args = parser.parse_args(argv)
|
return betterhelp.single_main(argv, parser, __doc__)
|
||||||
return args.func(args)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
raise SystemExit(main(sys.argv[1:]))
|
raise SystemExit(main(sys.argv[1:]))
|
||||||
|
|
Loading…
Reference in a new issue