(args)
| 661 | |
| 662 | |
| 663 | def main(args): |
| 664 | import argparse |
| 665 | parser = argparse.ArgumentParser() |
| 666 | textgroup = parser.add_argument_group('text only arguments') |
| 667 | htmlgroup = parser.add_argument_group('html only arguments') |
| 668 | textgroup.add_argument( |
| 669 | "-w", "--width", |
| 670 | type=int, default=2, |
| 671 | help="width of date column (default 2)" |
| 672 | ) |
| 673 | textgroup.add_argument( |
| 674 | "-l", "--lines", |
| 675 | type=int, default=1, |
| 676 | help="number of lines for each week (default 1)" |
| 677 | ) |
| 678 | textgroup.add_argument( |
| 679 | "-s", "--spacing", |
| 680 | type=int, default=6, |
| 681 | help="spacing between months (default 6)" |
| 682 | ) |
| 683 | textgroup.add_argument( |
| 684 | "-m", "--months", |
| 685 | type=int, default=3, |
| 686 | help="months per row (default 3)" |
| 687 | ) |
| 688 | htmlgroup.add_argument( |
| 689 | "-c", "--css", |
| 690 | default="calendar.css", |
| 691 | help="CSS to use for page" |
| 692 | ) |
| 693 | parser.add_argument( |
| 694 | "-L", "--locale", |
| 695 | default=None, |
| 696 | help="locale to use for month and weekday names" |
| 697 | ) |
| 698 | parser.add_argument( |
| 699 | "-e", "--encoding", |
| 700 | default=None, |
| 701 | help="encoding to use for output" |
| 702 | ) |
| 703 | parser.add_argument( |
| 704 | "-t", "--type", |
| 705 | default="text", |
| 706 | choices=("text", "html"), |
| 707 | help="output type (text or html)" |
| 708 | ) |
| 709 | parser.add_argument( |
| 710 | "year", |
| 711 | nargs='?', type=int, |
| 712 | help="year number" |
| 713 | ) |
| 714 | parser.add_argument( |
| 715 | "month", |
| 716 | nargs='?', type=int, |
| 717 | help="month number (1-12, text only)" |
| 718 | ) |
| 719 | |
| 720 | options = parser.parse_args(args[1:]) |
no test coverage detected