From f393b7f9924a028955408b97deb1f812f3390619 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 27 Feb 2018 19:47:27 +0200 Subject: Generate the "README"-s --- README | 37 +++++++++++++++++++++++++++++++++++++ README.html | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 README create mode 100644 README.html diff --git a/README b/README new file mode 100644 index 0000000..ac0ccfa --- /dev/null +++ b/README @@ -0,0 +1,37 @@ +usage: argparse-html.py [-h] [-a ARG_A] [-b PARAM_B] [-v] [-d] [-c] + [--html-usage] [--html-usage-raw] + + This script demonstrates how to automatically convert argparse + output to HTML. See also the class HTMLFormatter. + + It's a hack. It does not produce a very clean HTML (there's an + extra ', for instance). But it's good enough for me. An empty + (or spaces-only) line is considered as a paragraph separator. + + I needed to produce HTML as a single line and thus this is the + default output. This is not part of the class and can be easily + changed in the wrapper function html_usage(). + + + +optional arguments: + -h, --help show this help message and exit + -a ARG_A, --arg-a ARG_A + Set value of A. Default: 1.1. + -b PARAM_B, --param-b PARAM_B + Set value of B. Default: 2. + -v, --verbose Be verbose + +For Interactive Use: + -d, --no-act Do nothing. Just print what is to be run + -c, --config Do nothing. Just show configuration + --html-usage Do nothing. Format help as HTML (a single line) + --html-usage-raw If html-usage: don't squash HTML to a single line + + Note that we use RawTextHelpFormatter as the parser, rather than + HelpFormatter itself. Otherwise splitting to paragarphs with empty + lines won't show up in the standard --help output. + + If you have no problem with that, you can remove the formatter_class + parameter above. + diff --git a/README.html b/README.html new file mode 100644 index 0000000..fcdb5a3 --- /dev/null +++ b/README.html @@ -0,0 +1,37 @@ +

usage: argparse-html.py [-h] [-a ARG_A] [-b PARAM_B] [-v] [-d] [-c] + [--html-usage] [--html-usage-raw] + +

This script demonstrates how to automatically convert argparse + output to HTML. See also the class HTMLFormatter. +

+

It's a hack. It does not produce a very clean HTML (there's an + extra ', for instance). But it's good enough for me. An empty + (or spaces-only) line is considered as a paragraph separator. +

+

I needed to produce HTML as a single line and thus this is the + default output. This is not part of the class and can be easily + changed in the wrapper function html_usage().

+

optional arguments

+ +

For Interactive Use

+

Note that we use RawTextHelpFormatter as the parser, rather than + HelpFormatter itself. Otherwise splitting to paragarphs with empty + lines won't show up in the standard --help output. +

+

If you have no problem with that, you can remove the formatter_class + parameter above.

+ -- cgit v1.2.3