Show More
@@ -168,7 +168,10 b' def optrst(header, options, verbose):' | |||||
168 | # the %s-shows-repr property to handle integers etc. To |
|
168 | # the %s-shows-repr property to handle integers etc. To | |
169 | # match that behavior on Python 3, we do str(default) and |
|
169 | # match that behavior on Python 3, we do str(default) and | |
170 | # then convert it to bytes. |
|
170 | # then convert it to bytes. | |
171 |
de |
|
171 | defaultstr = pycompat.bytestr(default) | |
|
172 | if default is True: | |||
|
173 | defaultstr = _("on") | |||
|
174 | desc += _(" (default: %s)") % defaultstr | |||
172 |
|
175 | |||
173 | if isinstance(default, list): |
|
176 | if isinstance(default, list): | |
174 | lo += " %s [+]" % optlabel |
|
177 | lo += " %s [+]" % optlabel |
@@ -809,6 +809,8 b' this is a section and erroring out weird' | |||||
809 | > [(b'', b'longdesc', 3, b'x'*67), |
|
809 | > [(b'', b'longdesc', 3, b'x'*67), | |
810 | > (b'n', b'', None, b'normal desc'), |
|
810 | > (b'n', b'', None, b'normal desc'), | |
811 | > (b'', b'newline', b'', b'line1\nline2'), |
|
811 | > (b'', b'newline', b'', b'line1\nline2'), | |
|
812 | > (b'', b'default-off', False, b'enable X'), | |||
|
813 | > (b'', b'default-on', True, b'enable Y'), | |||
812 | > (b'', b'callableopt', func, b'adds foo'), |
|
814 | > (b'', b'callableopt', func, b'adds foo'), | |
813 | > (b'', b'customopt', customopt(''), b'adds bar'), |
|
815 | > (b'', b'customopt', customopt(''), b'adds bar'), | |
814 | > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')], |
|
816 | > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')], | |
@@ -903,6 +905,8 b' Test command with no help text' | |||||
903 | xxxxxxxxxxxxxxxxxxxxxxx (default: 3) |
|
905 | xxxxxxxxxxxxxxxxxxxxxxx (default: 3) | |
904 | -n -- normal desc |
|
906 | -n -- normal desc | |
905 | --newline VALUE line1 line2 |
|
907 | --newline VALUE line1 line2 | |
|
908 | --default-off enable X | |||
|
909 | --default-on enable Y (default: on) | |||
906 | --callableopt VALUE adds foo |
|
910 | --callableopt VALUE adds foo | |
907 | --customopt VALUE adds bar |
|
911 | --customopt VALUE adds bar | |
908 | --customopt-withdefault VALUE adds bar (default: foo) |
|
912 | --customopt-withdefault VALUE adds bar (default: foo) |
General Comments 0
You need to be logged in to leave comments.
Login now