Skip to content

fix: write output file when --output is given without --txt#2993

Open
ashvinctrl wants to merge 1 commit into
sherlock-project:masterfrom
ashvinctrl:fix/output-flag-ignored
Open

fix: write output file when --output is given without --txt#2993
ashvinctrl wants to merge 1 commit into
sherlock-project:masterfrom
ashvinctrl:fix/output-flag-ignored

Conversation

@ashvinctrl

Copy link
Copy Markdown

Summary

Fixes #2992

--output myfile.txt produced no file and no error unless --txt was also passed. The result_file variable was set correctly but the write block was gated exclusively on args.output_txt, making --output silently ignored on its own.

Change

sherlock_project/sherlock.py — one-line condition change:

# before
if args.output_txt:

# after
if args.output_txt or args.output:

This matches the documented behaviour: "the output of the result will be saved to this file" — no additional flag required.

Test plan

  • pytest tests/test_output_flag.py — new tests pass
  • pytest — full suite green
  • sherlock --output /tmp/out.txt someuser/tmp/out.txt is created
  • sherlock --txt someuser — still creates someuser.txt (no regression)
  • sherlock --output /tmp/out.txt --txt someuser — still works (no double-write)

@ashvinctrl ashvinctrl requested a review from ppfeister as a code owner June 10, 2026 06:13
Passing --output myfile.txt without --txt produced no output file and
no error, silently discarding the flag. The result_file variable was set
correctly but the write block was gated on args.output_txt alone.

Change the condition from `if args.output_txt` to
`if args.output_txt or args.output` so that specifying --output alone
is sufficient to write the file, matching the documented behaviour.

Fixes sherlock-project#2992
@ashvinctrl ashvinctrl force-pushed the fix/output-flag-ignored branch from 9edb4e3 to b9ce44e Compare June 18, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: --output flag silently ignored unless --txt is also passed

1 participant