#!/usr/bin/env python3
"""
Command-Line Usage Examples for eBay Research Tool

This script demonstrates all the different ways to use the new command-line arguments
for minPrice, maxPrice, and topRatedProducts parameters.
"""

import subprocess
import sys

def show_usage_examples():
    """Display comprehensive usage examples"""
    print("🚀 eBay Research Tool - Command-Line Usage Examples")
    print("="*60)

    print("\n📖 BASIC SYNTAX:")
    print("python3 login.py [keywords] [options]")

    print("\n📝 AVAILABLE OPTIONS:")
    print("  keywords                     Search keywords (optional, default: 'iphone case')")
    print("  --minPrice PRICE            Minimum price filter (e.g., --minPrice 10)")
    print("  --maxPrice PRICE            Maximum price filter (e.g., --maxPrice 100)")
    print("  --topRatedProducts FILTER   Top-rated filter: SHOW or EXCLUDE")
    print("  --dayRange DAYS             Day range (default: 90)")
    print("  --debug                     Enable debug output")

    print("\n" + "="*60)
    print("💡 USAGE EXAMPLES")
    print("="*60)

    examples = [
        {
            "title": "1. Default Search (No Arguments)",
            "command": "python3 login.py",
            "description": "Search for 'iphone case' with default settings (90 days, no price/rating filters)"
        },
        {
            "title": "2. Custom Keywords",
            "command": 'python3 login.py "wireless headphones"',
            "description": "Search for specific keywords"
        },
        {
            "title": "3. Price Range Filter",
            "command": 'python3 login.py "laptop bag" --minPrice 20 --maxPrice 100',
            "description": "Search with price range $20-$100"
        },
        {
            "title": "4. Budget Items Only",
            "command": 'python3 login.py "phone accessories" --maxPrice 25',
            "description": "Find items under $25"
        },
        {
            "title": "5. Premium Items Only",
            "command": 'python3 login.py "gaming laptop" --minPrice 500',
            "description": "Find items over $500"
        },
        {
            "title": "6. Top-Rated Products Only",
            "command": 'python3 login.py "electronics" --topRatedProducts SHOW',
            "description": "Show only top-rated seller listings"
        },
        {
            "title": "7. Exclude Top-Rated Products",
            "command": 'python3 login.py "camera equipment" --topRatedProducts EXCLUDE',
            "description": "Exclude top-rated sellers, show regular sellers only"
        },
        {
            "title": "8. Custom Time Range",
            "command": 'python3 login.py "smartphone" --dayRange 30',
            "description": "Search last 30 days instead of default 90 days"
        },
        {
            "title": "9. Combined Filters",
            "command": 'python3 login.py "wireless earbuds" --minPrice 50 --maxPrice 200 --topRatedProducts SHOW',
            "description": "Price range + top-rated sellers only"
        },
        {
            "title": "10. Complete Example with Debug",
            "command": 'python3 login.py "gaming headset" --minPrice 30 --maxPrice 150 --topRatedProducts EXCLUDE --dayRange 60 --debug',
            "description": "All parameters with debug output enabled"
        },
        {
            "title": "11. Market Comparison (Multiple Commands)",
            "command": """# Compare top-rated vs regular sellers
python3 login.py "tablet case" --topRatedProducts SHOW
python3 login.py "tablet case" --topRatedProducts EXCLUDE""",
            "description": "Run separate searches to compare different seller tiers"
        },
        {
            "title": "12. Price Segment Analysis",
            "command": """# Analyze different price segments
python3 login.py "bluetooth speaker" --maxPrice 50      # Budget
python3 login.py "bluetooth speaker" --minPrice 50 --maxPrice 150  # Mid-range
python3 login.py "bluetooth speaker" --minPrice 150     # Premium""",
            "description": "Segment market by price ranges"
        }
    ]

    for example in examples:
        print(f"\n{example['title']}")
        print("-" * len(example['title']))
        print(f"Command:")
        print(f"  {example['command']}")
        print(f"Description: {example['description']}")

    print("\n" + "="*60)
    print("🎯 REAL-WORLD SCENARIOS")
    print("="*60)

    scenarios = [
        {
            "scenario": "Budget Market Research",
            "commands": [
                'python3 login.py "phone case" --maxPrice 15',
                'python3 login.py "car charger" --maxPrice 20',
                'python3 login.py "earbuds" --maxPrice 30'
            ],
            "purpose": "Find affordable items for dropshipping"
        },
        {
            "scenario": "Premium Product Analysis",
            "commands": [
                'python3 login.py "luxury watch" --minPrice 500 --maxPrice 2000',
                'python3 login.py "high-end headphones" --minPrice 200 --topRatedProducts SHOW'
            ],
            "purpose": "Research high-value products from trusted sellers"
        },
        {
            "scenario": "Competitive Analysis",
            "commands": [
                'python3 login.py "laptop sleeve" --topRatedProducts SHOW --debug',
                'python3 login.py "laptop sleeve" --topRatedProducts EXCLUDE --debug'
            ],
            "purpose": "Compare performance of top-rated vs regular sellers"
        },
        {
            "scenario": "Seasonal Trend Analysis",
            "commands": [
                'python3 login.py "winter jacket" --dayRange 7',   # Last week
                'python3 login.py "winter jacket" --dayRange 30',  # Last month
                'python3 login.py "winter jacket" --dayRange 90'   # Last quarter
            ],
            "purpose": "Analyze selling trends over different time periods"
        }
    ]

    for scenario in scenarios:
        print(f"\n🔸 {scenario['scenario']}")
        print(f"   Purpose: {scenario['purpose']}")
        print(f"   Commands:")
        for cmd in scenario['commands']:
            print(f"     {cmd}")

    print("\n" + "="*60)
    print("⚡ QUICK REFERENCE")
    print("="*60)
    print("""
Basic:              python3 login.py "keywords"
With price range:   python3 login.py "keywords" --minPrice 10 --maxPrice 50
Top-rated only:     python3 login.py "keywords" --topRatedProducts SHOW
Exclude top-rated:  python3 login.py "keywords" --topRatedProducts EXCLUDE
Budget research:    python3 login.py "keywords" --maxPrice 25
Premium research:   python3 login.py "keywords" --minPrice 100
Recent sales:       python3 login.py "keywords" --dayRange 30
Debug mode:         python3 login.py "keywords" --debug

All parameters:     python3 login.py "keywords" --minPrice 20 --maxPrice 100 --topRatedProducts SHOW --dayRange 60 --debug
""")

    print("\n✅ Command-line interface ready for use!")
    print("💡 Tip: Use --debug to see detailed progress information")

if __name__ == "__main__":
    show_usage_examples()
