Created
July 14, 2023 23:58
-
-
Save mmcclimon/9205f664e4b1467059157815ed752745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import subprocess | |
parser = argparse.ArgumentParser() | |
parser.add_argument("issue", help="jira ticket id", type=str) | |
parser.add_argument("--markdown", "--md", action="store_true", help="generate a markdown link") | |
args = parser.parse_args() | |
issue = args.issue.upper() | |
link = f"https://jira.mongodb.org/browse/{issue}" | |
desc = "link" | |
if args.markdown: | |
link = f"[{issue}]({link})" | |
desc = "markdown link" | |
subprocess.run(["pbcopy"], input=link, encoding="ascii", check=True) | |
print(f"copied {desc} to {issue}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment