def main():  
parser = optparse.OptionParser()<EOL>parser.usage = textwrap.dedent("""<STR_LIT>""")<EOL>group = optparse.OptionGroup(<EOL>parser, '<STR_LIT>',<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>group.add_option(<EOL>'<STR_LIT>', '<STR_LIT>', dest='<STR_LIT>', action='<STR_LIT:store_true>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>')<EOL>group.add_option(<EOL>'<STR_LIT>', dest='<STR_LIT>',<EOL>action='<STR_LIT:store_true>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>')<EOL>group.add_option(<EOL>'<STR_LIT>', dest='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>', metavar='<STR_LIT>')<EOL>parser.add_option_group(group)<EOL>group = optparse.OptionGroup(parser, '<STR_LIT>')<EOL>group.add_option(<EOL>'<STR_LIT>', dest='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>')<EOL>group.add_option(<EOL>'<STR_LIT>', dest='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>',<EOL>metavar='<STR_LIT>')<EOL>group.add_option(<EOL>'<STR_LIT>', dest='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>',<EOL>metavar='<STR_LIT>')<EOL>group.add_option('<STR_LIT>', dest='<STR_LIT>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>',<EOL>metavar='<STR_LIT>')<EOL>group.add_option('<STR_LIT>', dest='<STR_LIT>', action='<STR_LIT:store_true>',<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>')<EOL>group.add_option('<STR_LIT>', dest='<STR_LIT>',<EOL>default=os.path.expanduser('<STR_LIT>'),<EOL>help='<STR_LIT>'<EOL>'<STR_LIT>',<EOL>metavar='<STR_LIT>')<EOL>parser.add_option_group(group)<EOL>opts, args = parser.parse_args()<EOL>if args:<EOL><INDENT>sys.exit('<STR_LIT>')<EOL><DEDENT>if not opts.configfile:<EOL><INDENT>cfg = os.path.expanduser('<STR_LIT>')<EOL>if os.path.isfile(cfg):<EOL><INDENT>opts.configfile = cfg<EOL><DEDENT><DEDENT>if not opts.configdir:<EOL><INDENT>cfg = os.path.expanduser('<STR_LIT>')<EOL>if os.path.isdir(cfg):<EOL><INDENT>opts.configdir = cfg<EOL><DEDENT><DEDENT>if opts.debug and not opts.logfile:<EOL><INDENT>parser.error('<STR_LIT>')<EOL><DEDENT>ap = None<EOL>try:<EOL><INDENT>ap = AuthProgs(logfile=opts.logfile,  <EOL>configfile=opts.configfile,<EOL>configdir=opts.configdir,<EOL>debug=opts.debug,<EOL>keyname=opts.keyname)<EOL>if opts.dump_config:<EOL><INDENT>ap.dump_config()<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>elif opts.install_key:<EOL><INDENT>try:<EOL><INDENT>ap.install_key(opts.install_key, opts.authorized_keys)<EOL>sys.stderr.write('<STR_LIT>')<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>except InstallError as err:<EOL><INDENT>sys.stderr.write('<STR_LIT>' % err)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>elif opts.run:<EOL><INDENT>ap.exec_command()<EOL>sys.exit('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>parser.error('<STR_LIT>')<EOL><DEDENT><DEDENT>except SSHEnvironmentError as err:<EOL><INDENT>ap.log('<STR_LIT>' % (<EOL>err, traceback.format_exc()))<EOL>sys.exit('<STR_LIT>' % err)<EOL><DEDENT>except ConfigError as err:<EOL><INDENT>ap.log('<STR_LIT>' % (<EOL>err, traceback.format_exc()))<EOL>sys.exit('<STR_LIT>' % err)<EOL><DEDENT>except CommandRejected as err:<EOL><INDENT>sys.exit('<STR_LIT>' % err)<EOL><DEDENT>except Exception as err:<EOL><INDENT>if ap:<EOL><INDENT>ap.log('<STR_LIT>' % (<EOL>err, traceback.format_exc()))<EOL><DEDENT>else:<EOL><INDENT>sys.stderr.write('<STR_LIT>' % (<EOL>err, traceback.format_exc()))<EOL><DEDENT>sys.exit('<STR_LIT>')<EOL><DEDENT>
Main.