#!/opt/anaconda1anaconda2anaconda3/bin/python
# -*- coding: utf-8

import sys

import anvio
import anvio.programs as programs
import anvio.terminal as terminal

from anvio.errors import ConfigError, FilesNPathsError

__author__ = "Developers of anvi'o (see AUTHORS.txt)"
__copyright__ = "Copyleft 2015-2018, the Meren Lab (http://merenlab.org/)"
__credits__ = ['Xabier Vázquez-Campos']
__license__ = "GPL 3.0"
__version__ = anvio.__version__
__maintainer__ = "A. Murat Eren"
__email__ = "a.murat.eren@gmail.com"

run = terminal.Run()
progress = terminal.Progress()

if __name__ == '__main__':
    import argparse
    parser = argparse.ArgumentParser(description="Generate a vignette for anvi'o programs")

    parser.add_argument(*anvio.A('output-file'), **anvio.K('output-file', {'default': 'vignette-out.md'}))
    parser.add_argument('-p', '--program-names-to-focus', default=None, help="Comma-spearated list of program names to focus\
                         Mostly for debugging purposes.")

    args = anvio.get_args(parser)

    try:
        vignette = programs.ProgramsVignette(args)
        vignette.generate()
    except ConfigError as e:
        print(e)
        sys.exit(-1)
    except FilesNPathsError as e:
        print(e)
        sys.exit(-2)
