# Path: pytest_bdd/scripts.py
# def main() -> None:
#     """Main entry point."""
#     parser = argparse.ArgumentParser(prog="pytest-bdd")
#     subparsers = parser.add_subparsers(help="sub-command help", dest="command")
#     subparsers.required = True
#     parser_generate = subparsers.add_parser("generate", help="generate help")
#     parser_generate.add_argument(
#         "files",
#         metavar="FEATURE_FILE",
#         type=check_existense,
#         nargs="+",
#         help="Feature files to generate test code with",
#     )
#     parser_generate.set_defaults(func=print_generated_code)
# 
#     parser_migrate = subparsers.add_parser("migrate", help="migrate help")
#     parser_migrate.add_argument("path", metavar="PATH", help="Migrate outdated tests to the most recent form")
#     parser_migrate.set_defaults(func=migrate_tests)
# 
#     args = parser.parse_args()
#     if hasattr(args, "func"):
#         args.func(args)


import os
import sys
from pytest_bdd.scripts import main
"""Main command."""



PATH = os.path.dirname(__file__)


def test_main(monkeypatch, capsys):
    """Test if main command shows help when called without the subcommand."""
    monkeypatch.setattr(sys, "argv", ["pytest-bdd"])
    monkeypatch.setattr(sys, "exit", lambda x: x)

# Path: pytest_bdd/scripts.py
# def main() -> None:
#     """Main entry point."""
#     parser = argparse.ArgumentParser(prog="pytest-bdd")
#     subparsers = parser.add_subparsers(help="sub-command help", dest="command")
#     subparsers.required = True
#     parser_generate = subparsers.add_parser("generate", help="generate help")
#     parser_generate.add_argument(
#         "files",
#         metavar="FEATURE_FILE",
#         type=check_existense,
#         nargs="+",
#         help="Feature files to generate test code with",
#     )
#     parser_generate.set_defaults(func=print_generated_code)
# 
#     parser_migrate = subparsers.add_parser("migrate", help="migrate help")
#     parser_migrate.add_argument("path", metavar="PATH", help="Migrate outdated tests to the most recent form")
#     parser_migrate.set_defaults(func=migrate_tests)
# 
#     args = parser.parse_args()
#     if hasattr(args, "func"):
#         args.func(args)


# Path: tests/scripts/test_main.py
import os
import sys
from pytest_bdd.scripts import main

"""Main command."""



PATH = os.path.dirname(__file__)


def test_main(monkeypatch, capsys):
    """Test if main command shows help when called without the subcommand."""
    monkeypatch.setattr(sys, "argv", ["pytest-bdd"])
    monkeypatch.setattr(sys, "exit", lambda x: x)

    main()