"""
nanocompass CLI - Command-line interface for nanocompass.

Author: Kevin R. Roy
Email: kevinrjroy@gmail.com
"""

import argparse
import sys

from . import __version__


def main():
    """Main entry point for nanocompass CLI."""
    parser = argparse.ArgumentParser(
        prog="nanocompass",
        description="Multi-aligner consensus framework for nanopore RNA-seq splice junction detection",
    )
    parser.add_argument(
        "--version", "-v",
        action="version",
        version=f"nanocompass {__version__}",
    )

    subparsers = parser.add_subparsers(dest="command", help="Available commands")

    # Align subcommand
    align_parser = subparsers.add_parser("align", help="Align reads with multiple aligners")
    align_parser.add_argument("--input", "-i", required=True, help="Input FASTQ file")
    align_parser.add_argument("--output", "-o", required=True, help="Output directory")
    align_parser.add_argument("--config", "-c", help="Configuration YAML file")
    align_parser.add_argument("--aligners", default="minimap2", help="Comma-separated list of aligners")

    # Compare subcommand
    compare_parser = subparsers.add_parser("compare", help="Compare junction calls across aligners")
    compare_parser.add_argument("--input", "-i", required=True, help="Input directory with alignment results")
    compare_parser.add_argument("--output", "-o", required=True, help="Output file")

    args = parser.parse_args()

    if args.command is None:
        parser.print_help()
        sys.exit(0)

    # TODO: Implement commands
    print(f"nanocompass {__version__}")
    print(f"Command: {args.command}")
    print("Implementation in progress...")


if __name__ == "__main__":
    main()
