(args=None)
| 809 | |
| 810 | |
| 811 | def main(args=None): |
| 812 | import argparse |
| 813 | parser = argparse.ArgumentParser(color=True) |
| 814 | textgroup = parser.add_argument_group('text only arguments') |
| 815 | htmlgroup = parser.add_argument_group('html only arguments') |
| 816 | textgroup.add_argument( |
| 817 | "-w", "--width", |
| 818 | type=int, default=2, |
| 819 | help="width of date column (default 2)" |
| 820 | ) |
| 821 | textgroup.add_argument( |
| 822 | "-l", "--lines", |
| 823 | type=int, default=1, |
| 824 | help="number of lines for each week (default 1)" |
| 825 | ) |
| 826 | textgroup.add_argument( |
| 827 | "-s", "--spacing", |
| 828 | type=int, default=6, |
| 829 | help="spacing between months (default 6)" |
| 830 | ) |
| 831 | textgroup.add_argument( |
| 832 | "-m", "--months", |
| 833 | type=int, default=3, |
| 834 | help="months per row (default 3)" |
| 835 | ) |
| 836 | htmlgroup.add_argument( |
| 837 | "-c", "--css", |
| 838 | default="calendar.css", |
| 839 | help="CSS to use for page" |
| 840 | ) |
| 841 | parser.add_argument( |
| 842 | "-L", "--locale", |
| 843 | default=None, |
| 844 | help="locale to use for month and weekday names" |
| 845 | ) |
| 846 | parser.add_argument( |
| 847 | "-e", "--encoding", |
| 848 | default=None, |
| 849 | help="encoding to use for output" |
| 850 | ) |
| 851 | parser.add_argument( |
| 852 | "-t", "--type", |
| 853 | default="text", |
| 854 | choices=("text", "html"), |
| 855 | help="output type (text or html)" |
| 856 | ) |
| 857 | parser.add_argument( |
| 858 | "-f", "--first-weekday", |
| 859 | type=int, default=0, |
| 860 | help="weekday (0 is Monday, 6 is Sunday) to start each week (default 0)" |
| 861 | ) |
| 862 | parser.add_argument( |
| 863 | "year", |
| 864 | nargs='?', type=int, |
| 865 | help="year number" |
| 866 | ) |
| 867 | parser.add_argument( |
| 868 | "month", |
no test coverage detected