Skip to content

Commit 1fe0d93

Browse files
committed
Use ArgumentDefaultsHelpFormatter for better help
1 parent 9e95c43 commit 1fe0d93

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Lib/calendar.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -878,28 +878,30 @@ def timegm(tuple):
878878

879879
def main(args=None):
880880
import argparse
881-
parser = argparse.ArgumentParser(color=True)
881+
parser = argparse.ArgumentParser(
882+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
883+
)
882884
textgroup = parser.add_argument_group('text only arguments')
883885
htmlgroup = parser.add_argument_group('html only arguments')
884886
textgroup.add_argument(
885887
"-w", "--width",
886888
type=int, default=2,
887-
help="width of date column (default 2)"
889+
help="width of date column"
888890
)
889891
textgroup.add_argument(
890892
"-l", "--lines",
891893
type=int, default=1,
892-
help="number of lines for each week (default 1)"
894+
help="number of lines for each week"
893895
)
894896
textgroup.add_argument(
895897
"-s", "--spacing",
896898
type=int, default=6,
897-
help="spacing between months (default 6)"
899+
help="spacing between months"
898900
)
899901
textgroup.add_argument(
900902
"-m", "--months",
901903
type=int, default=3,
902-
help="months per row (default 3)"
904+
help="months per row"
903905
)
904906
htmlgroup.add_argument(
905907
"-c", "--css",
@@ -914,7 +916,7 @@ def main(args=None):
914916
parser.add_argument(
915917
"-e", "--encoding",
916918
default=None,
917-
help="encoding to use for output (default utf-8)"
919+
help="encoding to use for output"
918920
)
919921
parser.add_argument(
920922
"-t", "--type",
@@ -925,7 +927,7 @@ def main(args=None):
925927
parser.add_argument(
926928
"-f", "--first-weekday",
927929
type=int, default=0,
928-
help="weekday (0 is Monday, 6 is Sunday) to start each week (default 0)"
930+
help="weekday (0 is Monday, 6 is Sunday) to start each week"
929931
)
930932
parser.add_argument(
931933
"year",

0 commit comments

Comments
 (0)