Skip to content

fix: default to 'scan' if only config file provided #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/mcp_scan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ def main():
add_install_arguments(proxy_parser)

# Parse arguments (default to 'scan' if no command provided)
args = parser.parse_args(["scan"] if len(sys.argv) == 1 else None)
if len(sys.argv) == 1:
args = parser.parse_args(["scan"])
elif len(sys.argv) == 2 and sys.argv[1] not in subparsers.choices:
args = parser.parse_args(["scan", sys.argv[1]])
else:
args = parser.parse_args()

# postprocess the files argument (if shorthands are used)
if hasattr(args, "files") and args.files is None:
Expand Down