From 70a417ac4d54ca1e5f77b8ac696d0d9ba1e5cd6e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 28 Dec 2015 12:06:26 +0000 Subject: Add help to CLI arguments --- scripts/mammoth | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/mammoth b/scripts/mammoth index b84d9a6..73a5b2b 100644 --- a/scripts/mammoth +++ b/scripts/mammoth @@ -85,14 +85,31 @@ class Output(object): def _parse_args(): parser = argparse.ArgumentParser() - parser.add_argument("path", metavar="docx-path") + parser.add_argument( + "path", + metavar="docx-path", + help="Path to the .docx file to convert.") output_group = parser.add_mutually_exclusive_group() - output_group.add_argument("output", nargs="?", metavar="output-path") - output_group.add_argument("--output-dir", nargs="?") + output_group.add_argument( + "output", + nargs="?", + metavar="output-path", + help="Output path for the generated document. Images will be stored inline in the output document. Output is written to stdout if not set.") + output_group.add_argument( + "--output-dir", + nargs="?", + help="Output directory for generated HTML and images. Images will be stored in separate files. Mutually exclusive with output-path.") - parser.add_argument("--output-format", required=False, choices=writers.formats()) - parser.add_argument("--style-map", required=False) + parser.add_argument( + "--output-format", + required=False, + choices=writers.formats(), + help="Output format.") + parser.add_argument( + "--style-map", + required=False, + help="File containg a style map.") return parser.parse_args() -- cgit v1.2.3