Skip to content

Commit

Permalink
Fixed quiet flag issue (#94)
Browse files Browse the repository at this point in the history
Signed-off-by: Zafer Balkan <zafer@zaferbalkan.com>
  • Loading branch information
zbalkan authored Dec 16, 2024
1 parent 6311d31 commit 13d17cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def with_args(self,
excluded_directories_string: Optional[str] = None,
excluded_pans_string: Optional[str] = None,
json_dir: Optional[str] = None,
size_limit: Optional[int] = None) -> None:
size_limit: Optional[int] = None,
quiet: Optional[bool] = None) -> None:
"""If any parameter is provided, it overwrites the previous value
"""

Expand All @@ -67,7 +68,8 @@ def with_args(self,
json_dir=json_dir,
excluded_directories_string=excluded_directories_string,
excluded_pans_string=excluded_pans_string,
size_limit=size_limit)
size_limit=size_limit,
quiet=quiet)

def with_file(self, config_file: str) -> None:
"""If a config file provided and it has specific values, they overwrite the previous values
Expand Down Expand Up @@ -104,7 +106,8 @@ def with_file(self, config_file: str) -> None:
json_dir=json_dir,
excluded_directories_string=excluded_directories_string,
excluded_pans_string=excluded_pans_string,
size_limit=size_limit)
size_limit=size_limit,
quiet=quiet)

def get_json_path(self) -> Optional[str]:
if self.json_dir:
Expand Down Expand Up @@ -160,7 +163,8 @@ def __update(self,
json_dir: Optional[str],
excluded_directories_string: Optional[str],
excluded_pans_string: Optional[str],
size_limit: Optional[int]) -> None:
size_limit: Optional[int],
quiet: Optional[bool] = False) -> None:

if search_dir and search_dir != 'None':
self.search_dir = os.path.abspath(path=search_dir)
Expand Down Expand Up @@ -189,3 +193,6 @@ def __update(self,

if size_limit:
self.size_limit = size_limit

if quiet:
self.quiet = quiet
3 changes: 2 additions & 1 deletion src/panhunt.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def main() -> None:
report_dir=report_dir,
json_dir=json_dir,
excluded_directories_string=excluded_directories_string,
excluded_pans_string=excluded_pans_string)
excluded_pans_string=excluded_pans_string,
quiet=quiet)

report: Report = hunt_pans()

Expand Down

0 comments on commit 13d17cf

Please sign in to comment.