def main(argv):
parser = get_parser()
# The parser arguments (cfg.args) are accessible everywhere after this call.
cfg.args = parser.parse_args()
# This initiates the global yml configuration instance so it will be
# accessible everywhere after this call.
cfg.initiate_config()
if not cfg.args.file and not cfg.args.q:
eprint("No file provided and not in query mode\n")
parser.print_help()
sys.exit(os.EX_USAGE)
jira, username = jiralogin.get_jira_instance(cfg.args.t)
if cfg.args.x or cfg.args.e:
if not cfg.args.q:
eprint("Arguments '-x' and '-e' can only be used together with '-q'")
sys.exit(os.EX_USAGE)
if cfg.args.p and not cfg.args.q:
eprint("Arguments '-p' can only be used together with '-q'")
sys.exit(os.EX_USAGE)
if cfg.args.q:
filename = get_jira_issues(jira, username)
if cfg.args.p:
print_status_file(filename)
sys.exit(os.EX_OK)
elif cfg.args.file is not None:
filename = cfg.args.file
else:
eprint("Trying to run script with unsupported configuration. Try using --help.")
sys.exit(os.EX_USAGE)
if get_editor():
open_editor(filename)
parse_status_file(jira, filename)
评论列表
文章目录