Skip to content

fix(input): make --top respect CLI ports and warn when it has no list - #969

Open
delaysystem wants to merge 1 commit into
bee-san:masterfrom
delaysystem:auto-batch1/m1-top-precedence
Open

delaysystem wants to merge 1 commit into
bee-san:masterfrom
delaysystem:auto-batch1/m1-top-precedence

Conversation

@delaysystem

@delaysystem delaysystem commented Nov 8, 2026 •

Copy link
Copy Markdown

Two --top defects in Opts::merge_optional:

  1. Config ports silently overrode explicit CLI -p/--range, against the CLI-wins rule from fix(config): let command-line options override the config file #947.
  2. --top with no configured list silently scanned the full range while the user believed it was the top 1000.

Now CLI ports/range win, and --top with no list warns and scans the full range. The --top help text now says where the list comes from.

Tests: 5 new merge tests covering all four combinations plus the no-top case; full gates green.

--top had two defects: with a config ports list it silently overrode
explicit -p/--range, contradicting the CLI-wins rule from bee-san#947; and
without a config ports list it silently scanned the full range while
the user believed the top ports were scanned. Now explicit CLI ports
or range take precedence, and --top with no configured list warns
that the full range will be scanned. The --top help text now says
where the list comes from.
@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

1 participant