This looks better as the concepts of host and port should be independent
from the application protocol.
parser.add_argument(
'-P', '--port', metavar="<port>",
parser.add_argument(
'-P', '--port', metavar="<port>",
- dest='port', default=poplib.POP3_PORT,
+ dest='port', default=None,
help='the port the pop3 server is listening on')
parser.add_argument(
help='the port the pop3 server is listening on')
parser.add_argument(
dest='ssl', action='store_const', const=True,
help='use SSL to connect to the pop3 server')
dest='ssl', action='store_const', const=True,
help='use SSL to connect to the pop3 server')
- parser.add_argument(
- '-S', '--ssl-port', metavar="<ssl_port>",
- dest='ssl_port', default=poplib.POP3_SSL_PORT,
- help='the port the SSL pop3 server is listening on')
-
parser = option_parser()
args = parser.parse_args()
parser = option_parser()
args = parser.parse_args()
- if args.ssl:
- port = args.ssl_port
+ if args.port is None:
+ if args.ssl:
+ port = poplib.POP3_SSL_PORT
+ else:
+ port = poplib.POP3_PORT