#!/bin/bash
# CVE Scanner CLI Wrapper

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PYTHON_SCRIPT="$SCRIPT_DIR/scripts/cve-scanner.py"

# Check if Python 3 is available
if ! command -v python3 &> /dev/null; then
    echo "Error: Python 3 is required but not installed."
    exit 1
fi

# Check if requirements are installed
if ! python3 -c "import requests" &> /dev/null; then
    echo "Warning: Required packages not found. Installing..."
    pip3 install -q -r "$SCRIPT_DIR/requirements.txt"
fi

# Run the scanner
python3 "$PYTHON_SCRIPT" "$@"
