| 1 |
# ---------------------------------------------------------------------------- |
| 2 |
# Copyright (c) 2011-2017, The BIOM Format Development Team. |
| 3 |
# |
| 4 |
# Distributed under the terms of the Modified BSD License. |
| 5 |
# |
| 6 |
# The full license is in the file COPYING.txt, distributed with this software. |
| 7 |
# ---------------------------------------------------------------------------- |
| 8 |
|
| 9 |
|
| 10 |
from importlib import import_module |
| 11 |
|
| 12 |
import click |
| 13 |
import biom |
| 14 |
|
| 15 |
|
| 16 |
def _terribly_handle_brokenpipeerror(): |
| 17 |
# based off http://stackoverflow.com/a/34299346 |
| 18 |
import os |
| 19 |
import sys |
| 20 |
sys.stdout = os.fdopen(1, 'w') |
| 21 |
|
| 22 |
|
| 23 |
@click.group(context_settings=dict(help_option_names=['-h', '--help'])) |
| 24 |
@click.version_option(version=biom.__version__) |
| 25 |
@click.pass_context |
| 26 |
def cli(ctx): |
| 27 |
ctx.call_on_close(_terribly_handle_brokenpipeerror) |
| 28 |
|
| 29 |
|
| 30 |
import_module('biom.cli.table_summarizer') |
| 31 |
import_module('biom.cli.metadata_adder') |
| 32 |
import_module('biom.cli.metadata_exporter') |
| 33 |
import_module('biom.cli.table_converter') |
| 34 |
import_module('biom.cli.installation_informer') |
| 35 |
import_module('biom.cli.table_subsetter') |
| 36 |
import_module('biom.cli.table_normalizer') |
| 37 |
import_module('biom.cli.table_head') |
| 38 |
import_module('biom.cli.table_ids') |
| 39 |
import_module('biom.cli.table_validator') |
| 40 |
import_module('biom.cli.uc_processor') |