#! /usr/bin/env python3
import pydoc

import click

from enru.enru import Enru
from enru.adapters.yandex import YandexAdapter


@click.command()
@click.argument('word')
@click.option('--show-examples', '-e',
              is_flag=True,
              default=False,
              help='Show word usage examples')
def main(word, show_examples):
    """Simple dictionaries translation parser"""
    parser = YandexAdapter()
    enru = Enru(parser)
    content = enru.run(word)
    pydoc.pipepager(content, cmd='less -R')

if __name__ == "__main__":
    main()
