Warn when --verbose-types is passed without a --list-* flag - #52
Open
elhoim wants to merge 1 commit into
Open
Conversation
Finding MISP#45 (verbose-types-inert): --verbose-types is accepted in every mode but only consumed by list_supported_types/list_active_modules. In the normal query path it silently forces the describeTypes fetch condition true with no effect and no warning, misleading users into thinking it changed behavior. Fix: emit a stderr warning when --verbose-types is passed without --list-supported-types or --list-active-modules, so the inert flag is no longer silent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finding 45 (Low) —
bin/cli.py:792-796Problem
--verbose-types is accepted in every mode but only consumed by list_supported_types/list_active_modules; in the normal query path it changes nothing except forcing the describeTypes fetch condition true, with no warning.
Fix
Finding #45 (verbose-types-inert, low severity): --verbose-types was accepted by argparse in every mode but only consumed by list_supported_types/list_active_modules. In the normal (non-list) query path, passing it had no effect other than forcing the describeTypes fetch condition true, with no indication to the user that the flag did nothing. Fix: added a check right after arg parsing in main() that emits a stderr warning ("[!] --verbose-types has no effect without --list-supported-types or --list-active-modules") when --verbose-types is passed without either --list-supported-types or --list-active-modules. Minimal 6-line addition, no other behavior changed.
Verification
Reproduced against the unmodified code at
9b8c605, then re-checked after the change.Before
After
python bin/cli.py --helpexits 0 and the module still imports cleanly. Verification was performed offline against the pure functions — no runningmisp-modulesinstance is required.Branched from
9b8c605. This PR addresses only this finding; the other findings from the same review are in separate PRs, so they will need rebasing against each other as they merge.🤖 Generated with Claude Code
https://claude.ai/code/session_01DYX4TKA5inzByJ4qGWKjqh