#!/usr/bin/env python
import click
from plumbum import local

from fmbiopy.bio import count_reads
from fmbiopy.cli import PlumbumPath


@click.command()
@click.argument("file", type=PlumbumPath(exists=True, dir_okay=False), nargs=1)
def cli(file):
    """Calculate the number of sequences in a fastq, fasta, sam or bam file.

    Gzipped inputs are accepted.
    """
    print(count_reads(file))


if __name__ == "__main__":
    cli()
