Skip to content

GUI-6092 - Exit if blind scan is used with anything other than --path as a directory#15

Open
eduardghita wants to merge 1 commit into
mainfrom
GUI-6092
Open

GUI-6092 - Exit if blind scan is used with anything other than --path as a directory#15
eduardghita wants to merge 1 commit into
mainfrom
GUI-6092

Conversation

@eduardghita

@eduardghita eduardghita commented May 19, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@eduardghita eduardghita self-assigned this May 19, 2025
Copilot AI review requested due to automatic review settings May 19, 2025 10:32
@eduardghita eduardghita changed the title GUI-6092 - Exit if blind scan is used with anything other than --path… GUI-6092 - Exit if blind scan is used with anything other than --path as a directory May 19, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a check to ensure that when --blind_scan is used, the provided --path argument refers to a directory.

  • Resolves the real filesystem path for args.path
  • Exits with an error message if --blind_scan is combined with a non-directory path
Comments suppressed due to low confidence (1)

workbench-agent.py:1269

  • Add a unit test for the case where --blind_scan is used with a non-directory path to verify that this validation triggers the expected error.
if args.blind_scan and not os.path.isdir(real_path):

Comment thread workbench-agent.py
Comment on lines +1270 to +1271
print("--path must be a directory when --blind_scan is used")
sys.exit(1)

Copilot AI May 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use parser.error(...) instead of print and sys.exit for argument validation so that the usage message is shown and error handling is consistent with other CLI errors.

Suggested change
print("--path must be a directory when --blind_scan is used")
sys.exit(1)
parser.error("--path must be a directory when --blind_scan is used")

Copilot uses AI. Check for mistakes.
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