Skip to content

fix(factory): support '-' as stdin sentinel for --input-file#337

Merged
JoshMock merged 2 commits into
mainfrom
fix/input-file-stdin-sentinel
May 18, 2026
Merged

fix(factory): support '-' as stdin sentinel for --input-file#337
JoshMock merged 2 commits into
mainfrom
fix/input-file-stdin-sentinel

Conversation

@flobernd
Copy link
Copy Markdown
Member

Summary

  • Treat --input-file - as a request to read JSON input from stdin, matching the Unix convention used by curl, kubectl, jq, and similar tools.
  • Previously elastic <cmd> --input-file - failed with Error: --input-file: file not found: - because the resolver passed - to readFileSync unconditionally.
  • The fix detects the - sentinel before the file-read branch and delegates to the existing module-level stdinReader; error messages continue to use the --input-file source label for consistency.

Closes #335

Treat `--input-file -` as a request to read input from stdin, matching
the convention used by curl, kubectl, jq, and other Unix tools. Without
this, the resolver attempted to open a file literally named `-` and
failed with "file not found: -".
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 8.96s
✅ REPOSITORY gitleaks yes no no 55.12s
✅ REPOSITORY git_diff yes no no 0.53s
✅ REPOSITORY secretlint yes no no 30.56s
✅ REPOSITORY trivy yes no no 18.96s
✅ TYPESCRIPT eslint 2 0 0 7.01s

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@JoshMock JoshMock enabled auto-merge (squash) May 18, 2026 17:33
@JoshMock JoshMock merged commit ad970e0 into main May 18, 2026
18 of 19 checks passed
@JoshMock JoshMock deleted the fix/input-file-stdin-sentinel branch May 18, 2026 17:40
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.

--input-file does not accept '-' for stdin; breaks Unix convention

2 participants