cli: remove unneeded boolean arguments

This commit is contained in:
Casper da Costa-Luis 2020-07-01 02:03:49 +01:00
parent 7249910dcb
commit c0d9c6173b
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
3 changed files with 12 additions and 10 deletions

View File

@ -91,6 +91,7 @@ tqdm/tqdm.1: .meta/.tqdm.1.md tqdm/cli.py tqdm/std.py
python -m tqdm --help | tail -n+5 |\
sed -r -e 's/\\/\\\\/g' \
-e 's/^ (--.*)=<(.*)> : (.*)$$/\n\\\1=*\2*\n: \3./' \
-e 's/^ (--.*) : (.*)$$/\n\\\1\n: \2./' \
-e 's/ (-.*, )(--.*) /\n\1\\\2\n: /' |\
cat "$<" - |\
pandoc -o "$@" -s -t man

View File

@ -198,8 +198,9 @@ def main(fp=sys.stderr, argv=None):
# d = RE_OPTS.sub(r' --\1=<\1> : \2', d)
split = RE_OPTS.split(d)
opt_types_desc = zip(split[1::3], split[2::3], split[3::3])
d = ''.join('\n --{0}=<{1}> : {2}{3}'.format(
otd[0].replace('_', '-'), otd[0], *otd[1:])
d = ''.join(('\n --{0} : {2}{3}' if otd[1] == 'bool' else
'\n --{0}=<{1}> : {2}{3}').format(
otd[0].replace('_', '-'), otd[0], *otd[1:])
for otd in opt_types_desc if otd[0] not in UNSUPPORTED_OPTS)
d = """Usage:

View File

@ -63,7 +63,7 @@ specify an initial arbitrary large positive number, e.g.
.RS
.RE
.TP
.B \-\-leave=\f[I]leave\f[]
.B \-\-leave
bool, optional.
If [default: True], keeps all traces of the progressbar upon termination
of iteration.
@ -117,7 +117,7 @@ The fallback is to use ASCII characters " 123456789#".
.RS
.RE
.TP
.B \-\-disable=\f[I]disable\f[]
.B \-\-disable
bool, optional.
Whether to disable the entire progressbar wrapper [default: False].
If set to None, disable on non\-TTY.
@ -140,7 +140,7 @@ If any other non\-zero number, will scale \f[C]total\f[] and \f[C]n\f[].
.RS
.RE
.TP
.B \-\-dynamic\-ncols=\f[I]dynamic_ncols\f[]
.B \-\-dynamic\-ncols
bool, optional.
If set, constantly alters \f[C]ncols\f[] and \f[C]nrows\f[] to the
environment (allowing for window resizes) [default: False].
@ -202,7 +202,7 @@ float, optional.
.RS
.RE
.TP
.B \-\-write\-bytes=\f[I]write_bytes\f[]
.B \-\-write\-bytes
bool, optional.
If (default: None) and \f[C]file\f[] is unspecified, bytes will be
written in Python 2.
@ -243,7 +243,7 @@ specified.
.RS
.RE
.TP
.B \-\-bytes=\f[I]bytes\f[]
.B \-\-bytes
bool, optional.
If true, will count bytes, ignore \f[C]delim\f[], and default
\f[C]unit_scale\f[] to True, \f[C]unit_divisor\f[] to 1024, and
@ -258,21 +258,21 @@ If true, passes \f[C]stdin\f[] to both \f[C]stderr\f[] and
.RS
.RE
.TP
.B \-\-update=\f[I]update\f[]
.B \-\-update
bool, optional.
If true, will treat input as newly elapsed iterations, i.e.
numbers to pass to \f[C]update()\f[].
.RS
.RE
.TP
.B \-\-update\-to=\f[I]update_to\f[]
.B \-\-update\-to
bool, optional.
If true, will treat input as total elapsed iterations, i.e.
numbers to assign to \f[C]self.n\f[].
.RS
.RE
.TP
.B \-\-null=\f[I]null\f[]
.B \-\-null
bool, optional.
If true, will discard input (no stdout).
.RS