#NEWLINE# def main( ) : #NEWLINE# #INDENT# global debug_mode , api_key , root_url , user_id , verify_ssl #NEWLINE# parser = argparse . ArgumentParser ( ) #NEWLINE# subparsers = parser . add_subparsers ( ) #NEWLINE# parser . add_argument ( '--key' , metavar = 'APIKEY' , default = None , help = 'set API key' ) #NEWLINE# parser . add_argument ( '--debug' , action = 'store_true' , default = False , help = 'write received data in debug.json' ) #NEWLINE# parser . add_argument ( '--root-url' , help = 'root url of Redmine instance' ) #NEWLINE# parser . add_argument ( '--user-id' , help = 'your Redmine user id' ) #NEWLINE# parser . add_argument ( '--version' , action = 'version' , version = '{0}.{1}.{2}' . format ( * __version__ ) ) #NEWLINE# parser_query = subparsers . add_parser ( 'query' , help = 'run a saved query by id' ) #NEWLINE# parser_query . add_argument ( 'project' ) #NEWLINE# parser_query . add_argument ( 'query_id' , type = int ) #NEWLINE# parser_query . set_defaults ( func = cmd_query ) #NEWLINE# parser_issues = subparsers . add_parser ( 'issues' , help = 'show my issues' ) #NEWLINE# parser_issues . set_defaults ( func = cmd_issues ) #NEWLINE# parser_open = subparsers . add_parser ( 'open' , help = 'open an issue in default browser' ) #NEWLINE# parser_open . add_argument ( 'issue_id' , type = int ) #NEWLINE# parser_open . set_defaults ( func = cmd_open ) #NEWLINE# parser_issue = subparsers . add_parser ( 'issue' , help = 'show details on an issue' ) #NEWLINE# parser_issue . add_argument ( 'issue_id' ) #NEWLINE# parser_issue . set_defaults ( func = cmd_issue ) #NEWLINE# args = parser . parse_args ( ) #NEWLINE# debug_mode = args . debug #NEWLINE# api_key = args . key #NEWLINE# root_url = args . root_url #NEWLINE# user_id = api_key . user_id #NEWLINE# args . func ( args )