From: Antonio Ospite Date: Tue, 9 Apr 2013 12:16:09 +0000 (+0200) Subject: Use the --port option also for SSL, drop the --ssl-port options X-Git-Url: https://git.ao2.it/crackpop.git/commitdiff_plain/HEAD?hp=38d8e69e7cc789683e68005846a747aa6e23f1cc Use the --port option also for SSL, drop the --ssl-port options This looks better as the concepts of host and port should be independent from the application protocol. --- diff --git a/crackpop.py b/crackpop.py index 8d9a45b..d44ed28 100755 --- a/crackpop.py +++ b/crackpop.py @@ -84,7 +84,7 @@ def option_parser(): parser.add_argument( '-P', '--port', metavar="", - dest='port', default=poplib.POP3_PORT, + dest='port', default=None, help='the port the pop3 server is listening on') parser.add_argument( @@ -107,11 +107,6 @@ def option_parser(): dest='ssl', action='store_const', const=True, help='use SSL to connect to the pop3 server') - parser.add_argument( - '-S', '--ssl-port', metavar="", - dest='ssl_port', default=poplib.POP3_SSL_PORT, - help='the port the SSL pop3 server is listening on') - return parser @@ -119,8 +114,11 @@ if __name__ == "__main__": 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 else: port = args.port