# HG changeset patch # User Paul Boddie # Date 1543349584 -3600 # Node ID dcdee3b1a6508f6f9324e4a079ba13ed5c44159b # Parent be82806b331a0ab3f749c51b828a5021d30f2e2f Added a help message and option. diff -r be82806b331a -r dcdee3b1a650 moinconvert --- a/moinconvert Tue Nov 27 21:12:40 2018 +0100 +++ b/moinconvert Tue Nov 27 21:13:04 2018 +0100 @@ -78,6 +78,10 @@ dirname, progname = split(sys.argv[0]) args = sys.argv[1:] + if "--help" in args: + show_help(progname) + sys.exit(0) + # Option values. l = filenames = [] @@ -307,6 +311,53 @@ if theme: theme.install_resources() +def show_help(progname): + + "Show the help text." + + print >>sys.stderr, help_text % progname + +help_text = """\ +Usage: %s [ ] ( --all | ... ) + +Input options: + +--all Detect all document files in the specified input directory +--input-dir Indicate an input directory containing document files +--input-dir-type Indicate the type of input directory involved + (default: directory) +--input-encoding Indicate the character encoding used in document files +--input-page-sep Indicate the separator used in filenames to encode + hierarchical relationships (subpages and descendant pages) +--pagename Indicate the page name corresponding to an indicated + filename, with each successive instance of this option + corresponding to each successive filename instance + +Output options: + +--format Indicate the format to be used for serialised documents + (default: html) +--fragment Indicates that an output fragment, not an entire document, + is to be generated, skipping any theming activities +--output-dir Indicate an output directory to contain serialised document + files +--output-encoding Indicate the character encoding used in serialised document + files +--theme Indicate a theme for serialised documents, typically + requiring an output directory to be useful +--tree Produce a document tree representation on standard output + instead of generating output files + +Configuration options: + +--macros Perform macro evaluation/expansion before serialising + documents +--mapping Indicate a name and corresponding URL to be used to + translate interwiki links +--root Indicate the root page name to be used + (default: FrontPage) +""" + if __name__ == "__main__": main()