Skip to content

Commit

Permalink
Merge pull request #8 from RyanLua/dynamic-version
Browse files Browse the repository at this point in the history
Make version dynamic for `--version` flag
  • Loading branch information
RyanLua authored Aug 5, 2024
2 parents f10fe8e + 03825bb commit c576ed3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/instawebhooks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from datetime import datetime, timedelta
from itertools import dropwhile, takewhile
from time import sleep
import importlib.metadata

try:
from aiohttp import ClientSession
Expand Down Expand Up @@ -41,6 +42,8 @@ def closure_check_regex(arg_value):
return closure_check_regex


version = importlib.metadata.version("instawebhooks")

# Set up logging
logger = logging.getLogger(__name__)
logging.basicConfig(
Expand Down Expand Up @@ -90,7 +93,7 @@ def closure_check_regex(arg_value):
help="don't show the post embed and only send message content",
action="store_true",
)
parser.add_argument("--version", action="version", version="%(prog)s 0.1.1")
parser.add_argument("--version", action="version", version="%(prog)s " + version)
args = parser.parse_args()

# Set the logger to debug if verbose is enabled
Expand Down

0 comments on commit c576ed3

Please sign in to comment.