Skip to content

fix(cli): search-dir and html flag behaviour#16

Open
swarit-stepsecurity wants to merge 1 commit intostep-security:mainfrom
swarit-stepsecurity:swarit/fix/cli-flags
Open

fix(cli): search-dir and html flag behaviour#16
swarit-stepsecurity wants to merge 1 commit intostep-security:mainfrom
swarit-stepsecurity:swarit/fix/cli-flags

Conversation

@swarit-stepsecurity
Copy link
Copy Markdown
Member

@swarit-stepsecurity swarit-stepsecurity commented Apr 8, 2026

What does this PR do?

cli.go — two fixes, two helpers:

  • --search-dirs greedy loop now stops at flags (- prefix) and known commands, not just -- prefix
  • --html now rejects flag-looking arguments as the file path
  • Added looksLikeFlag(s) — matches any - prefixed arg
  • Added isCommand(s) — matches known command names (install, uninstall, send-telemetry, configure, version, help)

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

Signed-off-by: Swarit Pandey <swarit.pandey@gmail.com>
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.

2 participants