Skip to content

Commit

Permalink
Made certain parts more logical for the boolean flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Miauwkeru committed Jul 18, 2024
1 parent 8604de1 commit 96d4f62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions acquire/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def recyclebin_filter(path: fsutil.TargetPath) -> bool:
help="Collect files larger than 10MB in the Recycle Bin",
)
@module_arg(
"--no-data-files",
"--data-files",
action=argparse.BooleanOptionalAction,
help="Skip collection of data files in the Recycle Bin",
)
Expand All @@ -681,7 +681,7 @@ def _run(cls, target: Target, cli_args: argparse.Namespace, collector: Collector

patterns = ["$Recycle.bin/*/$I*", "Recycler/*/INFO2", "Recycled/INFO2"]

if not cli_args.no_data_files:
if cli_args.data_files is not None and cli_args.data_files:

Check warning on line 684 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L684

Added line #L684 was not covered by tests
patterns.extend(["$Recycle.Bin/$R*", "$Recycle.Bin/*/$R*", "RECYCLE*/D*"])

with collector.file_filter(large_files_filter):
Expand Down
6 changes: 3 additions & 3 deletions acquire/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
)
parser.add_argument("--public-key", type=Path, help=argparse.SUPPRESS)
parser.add_argument("-l", "--log", type=Path, help="log directory location")
parser.add_argument("--no-log", action=argparse.BooleanOptionalAction, help=argparse.SUPPRESS)
parser.add_argument("--no-log", action="store_true", help=argparse.SUPPRESS)
parser.add_argument(
"-L",
"--loader",
Expand All @@ -115,7 +115,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
parser.add_argument("-g", "--glob", action="append", help="acquire files matching glob pattern")

parser.add_argument(
"--disable-report", action=argparse.BooleanOptionalAction, help="disable acquisition report file"
"--disable-report", action="store_true", help="disable acquisition report file"
)

parser.add_argument("--child", help="only collect specific child")
Expand Down Expand Up @@ -153,7 +153,7 @@ def create_argument_parser(profiles: dict, volatile: dict, modules: dict) -> arg
nargs="+",
help="upload specified files (all other acquire actions are ignored)",
)
parser.add_argument("--no-proxy", action=argparse.BooleanOptionalAction, help="don't autodetect proxies")
parser.add_argument("--no-proxy", action="store_true", help="don't autodetect proxies")

for module_cls in modules.values():
for args, kwargs in module_cls.__cli_args__:
Expand Down

0 comments on commit 96d4f62

Please sign in to comment.