Improve tempeditor docstring.

This commit is contained in:
voussoir 2021-05-13 12:20:19 -07:00
parent 1c70619df0
commit 0722514c47
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -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:]))