Skip to content

Commit

Permalink
added --version command for fedn package
Browse files Browse the repository at this point in the history
  • Loading branch information
sowmyasris committed Jul 3, 2024
1 parent 2485fb4 commit ba333c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fedn/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import click

import importlib.metadata
CONTEXT_SETTINGS = dict(
# Support -h as a shortcut for --help
help_option_names=["-h", "--help"],
)


# Dynamically get the version of the package
try:
version = importlib.metadata.version('fedn')
except importlib.metadata.PackageNotFoundError:
version = 'unknown'
@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(version)
@click.pass_context
def main(ctx):
""":param ctx:
Expand Down

0 comments on commit ba333c3

Please sign in to comment.