(parser, opts)
| 2 | |
| 3 | |
| 4 | def common_options(parser, opts): |
| 5 | parser.add_argument( |
| 6 | "--version", |
| 7 | action="store_true", |
| 8 | help="show version number and exit", |
| 9 | dest="version", |
| 10 | ) |
| 11 | parser.add_argument( |
| 12 | "--options", |
| 13 | action="store_true", |
| 14 | help="Show all options and their default values", |
| 15 | ) |
| 16 | parser.add_argument( |
| 17 | "--commands", |
| 18 | action="store_true", |
| 19 | help="Show all commands and their signatures", |
| 20 | ) |
| 21 | parser.add_argument( |
| 22 | "--set", |
| 23 | type=str, |
| 24 | dest="setoptions", |
| 25 | default=[], |
| 26 | action="append", |
| 27 | metavar="option[=value]", |
| 28 | help=""" |
| 29 | Set an option. When the value is omitted, booleans are set to true, |
| 30 | strings and integers are set to None (if permitted), and sequences |
| 31 | are emptied. Boolean values can be true, false or toggle. |
| 32 | Sequences are set using multiple invocations to set for |
| 33 | the same option. |
| 34 | """, |
| 35 | ) |
| 36 | parser.add_argument( |
| 37 | "-q", "--quiet", action="store_true", dest="quiet", help="Quiet." |
| 38 | ) |
| 39 | parser.add_argument( |
| 40 | "-v", |
| 41 | "--verbose", |
| 42 | action="store_const", |
| 43 | dest="verbose", |
| 44 | const="debug", |
| 45 | help="Increase log verbosity.", |
| 46 | ) |
| 47 | |
| 48 | # Basic options |
| 49 | opts.make_parser(parser, "mode", short="m") |
| 50 | opts.make_parser(parser, "anticache") |
| 51 | opts.make_parser(parser, "showhost") |
| 52 | opts.make_parser(parser, "show_ignored_hosts") |
| 53 | opts.make_parser(parser, "rfile", metavar="PATH", short="r") |
| 54 | opts.make_parser(parser, "scripts", metavar="SCRIPT", short="s") |
| 55 | opts.make_parser(parser, "stickycookie", metavar="FILTER") |
| 56 | opts.make_parser(parser, "stickyauth", metavar="FILTER") |
| 57 | opts.make_parser(parser, "save_stream_file", metavar="PATH", short="w") |
| 58 | opts.make_parser(parser, "anticomp") |
| 59 | |
| 60 | # Proxy options |
| 61 | group = parser.add_argument_group("Proxy Options") |
no test coverage detected
searching dependent graphs…