Use betterhelp.

This commit is contained in:
voussoir 2022-04-07 13:48:26 -07:00
parent bb8618b414
commit 5cd856073c
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -18,6 +18,7 @@ import sys
import traceback import traceback
import warnings import warnings
from voussoirkit import betterhelp
from voussoirkit import pathclass from voussoirkit import pathclass
HTML_TEMPLATE = ''' HTML_TEMPLATE = '''
@ -827,16 +828,32 @@ def markdown_argparse(args):
def main(argv): def main(argv):
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('md_filename') parser.add_argument('md_filename')
parser.add_argument('--css', dest='css', action='append', default=None) parser.add_argument(
parser.add_argument('--embed_images', '--embed-images', dest='do_embed_images', action='store_true') '--css',
parser.add_argument('-o', '--output', dest='output_filename', default=None) action='append',
parser.add_argument('--server', dest='server', type=int, default=None) default=None,
)
parser.add_argument(
'--embed_images',
'--embed-images',
dest='do_embed_images',
action='store_true',
)
parser.add_argument(
'-o',
'--output',
dest='output_filename',
default=None,
)
parser.add_argument(
'--server',
type=int,
default=None,
)
parser.set_defaults(func=markdown_argparse) parser.set_defaults(func=markdown_argparse)
args = parser.parse_args(argv) return betterhelp.go(parser, argv)
return args.func(args)
if __name__ == '__main__': if __name__ == '__main__':
raise SystemExit(main(sys.argv[1:])) raise SystemExit(main(sys.argv[1:]))