parser.add_option('', '--package', action = 'store', default = 'NTLM', help = 'The SSPI package to use (eg, Kerberos) - default is NTLM')
parser.add_option('', '--target-spn', action = 'store', help = "The target security provider name to use. The\n string contents are security-package specific. For\n example, 'Kerberos' or 'Negotiate' require the server\n principal name (SPN) (ie, the username) of the remote\n process. For NTLM this must be blank.")
parser.add_option('', '--port', action = 'store', default = '8181', help = 'The port number to use (default=8181)')
parser.add_option('', '--wait', action = 'store_true', help = 'Cause the program to wait for input just before\n terminating. Useful when using via runas to see\n any error messages before termination.\n ')
(options, args) = parser.parse_args()
try:
options.port = int(options.port)
except (ValueError, TypeError):
parser.error('--port must be an integer')
try:
if not args:
args = [
'']
if args[0] == 'client':
sspi_client()
elif args[0] == 'server':
serve()
else:
parser.error("You must supply 'client' or 'server' - use --help for details")