Skip to content

Commit

Permalink
settings: Move command-line parser setup out of Settings class
Browse files Browse the repository at this point in the history
We want the Settings-related command-line options to be co-located with
the Settings class, as the two likely need to be changed together, when
we add/modify settings to FawltyDeps. Still, they don't necessarily need
to be part of the same _class_. This makes the Settings class somewhat
smaller.

Suggested-by: Maria Knorps <[email protected]>
  • Loading branch information
jherland committed Feb 23, 2023
1 parent dd36630 commit da5877b
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 190 deletions.
4 changes: 2 additions & 2 deletions fawltydeps/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from fawltydeps import extract_imports
from fawltydeps.check import compare_imports_to_dependencies
from fawltydeps.extract_declared_dependencies import extract_declared_dependencies
from fawltydeps.settings import Action, OutputFormat, Settings
from fawltydeps.settings import Action, OutputFormat, Settings, setup_cmdline_parser
from fawltydeps.types import (
DeclaredDependency,
ParsedImport,
Expand Down Expand Up @@ -156,7 +156,7 @@ def print_human_readable(self, out: TextIO, details: bool = True) -> None:

def main() -> int:
"""Command-line entry point."""
parser, option_group = Settings.setup_cmdline_parser(description=__doc__)
parser, option_group = setup_cmdline_parser(description=__doc__)
option_group.add_argument(
"-V",
"--version",
Expand Down
Loading

0 comments on commit da5877b

Please sign in to comment.