Skip to content

Commit

Permalink
Add the --version option to the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nour-Mws committed Feb 9, 2023
1 parent 26f33d0 commit 5dad899
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fawltydeps/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from pathlib import Path
from typing import List, Optional, Set, TextIO

import pkg_resources

from fawltydeps import extract_imports
from fawltydeps.check import compare_imports_to_dependencies
from fawltydeps.extract_declared_dependencies import extract_declared_dependencies
Expand Down Expand Up @@ -132,6 +134,13 @@ def main() -> int:
const={Action.REPORT_UNDECLARED, Action.REPORT_UNUSED},
help="Report both undeclared and unused dependencies",
)
parser.add_argument(
"-V",
"--version",
action="version",
version=f"Fawltydeps {pkg_resources.get_distribution('fawltydeps').version}",
help=("Print the version number of fawltydeps"),
)
select_action.add_argument(
"--check-undeclared",
dest="actions",
Expand Down

0 comments on commit 5dad899

Please sign in to comment.