Skip to content

Commit 567e09b

Browse files
committed
Use ArgumentDefaultsHelpFormatter for better help
1 parent dedd347 commit 567e09b

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

Lib/calendar.py

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

877877
def main(args=None):
878878
import argparse
879-
parser = argparse.ArgumentParser(color=True)
879+
parser = argparse.ArgumentParser(
880+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
881+
)
880882
textgroup = parser.add_argument_group('text only arguments')
881883
htmlgroup = parser.add_argument_group('html only arguments')
882884
textgroup.add_argument(
883885
"-w", "--width",
884886
type=int, default=2,
885-
help="width of date column (default 2)"
887+
help="width of date column"
886888
)
887889
textgroup.add_argument(
888890
"-l", "--lines",
889891
type=int, default=1,
890-
help="number of lines for each week (default 1)"
892+
help="number of lines for each week"
891893
)
892894
textgroup.add_argument(
893895
"-s", "--spacing",
894896
type=int, default=6,
895-
help="spacing between months (default 6)"
897+
help="spacing between months"
896898
)
897899
textgroup.add_argument(
898900
"-m", "--months",
899901
type=int, default=3,
900-
help="months per row (default 3)"
902+
help="months per row"
901903
)
902904
htmlgroup.add_argument(
903905
"-c", "--css",
@@ -912,7 +914,7 @@ def main(args=None):
912914
parser.add_argument(
913915
"-e", "--encoding",
914916
default=None,
915-
help="encoding to use for output (default utf-8)"
917+
help="encoding to use for output"
916918
)
917919
parser.add_argument(
918920
"-t", "--type",
@@ -923,7 +925,7 @@ def main(args=None):
923925
parser.add_argument(
924926
"-f", "--first-weekday",
925927
type=int, default=0,
926-
help="weekday (0 is Monday, 6 is Sunday) to start each week (default 0)"
928+
help="weekday (0 is Monday, 6 is Sunday) to start each week"
927929
)
928930
parser.add_argument(
929931
"year",

0 commit comments

Comments
 (0)