Skip to content

Commit

Permalink
Use correct package name.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Apr 9, 2022
1 parent 24d2b64 commit a682d4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/antsibull_core/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ class InvalidArgumentError(Exception):
"""A problem parsing or validating a command line argument."""


def get_toplevel_parser(**kwargs) -> argparse.ArgumentParser:
def get_toplevel_parser(package, **kwargs) -> argparse.ArgumentParser:
"""
Create a toplevel argument parser with options common across all scripts.
:arg package: The Python package containing this CLI program.
:args kwargs: This function takes any keyword arguments and passes them directly on to
the :class:`argparse.ArgumentParser` constructor.
:returns: :class:`argparse.ArgumentParser` with common script arguments added.
"""
try:
version = metadata.version('antsibull')
version = metadata.version(package)
except metadata.PackageNotFoundError:
# If there's no metadata foun, assume we're running from source
version = 'source'
Expand Down

0 comments on commit a682d4a

Please sign in to comment.