# Path: vcs/cli.py
# COMPLETION_ENV_NAME = 'VCS_AUTO_COMPLETE'
# class ExecutionManager(object):
# class BaseCommand(object):
# class RepositoryCommand(BaseCommand):
# class ChangesetCommand(RepositoryCommand):
# class SingleChangesetCommand(RepositoryCommand):
#     def __init__(self, argv=None, stdout=None, stderr=None):
#     def get_vcsrc(self):
#     def get_argv_for_command(self):
#     def execute(self):
#     def autocomplete(self):
#     def get_command_class(self, cmd):
#     def get_commands(self):
#     def run_command(self, cmd, argv):
#     def show_help(self):
#     def __init__(self, stdout=None, stderr=None):
#     def get_version(self):
#     def usage(self, subcommand):
#     def get_option_list(self):
#     def get_parser(self, prog_name, subcommand):
#     def print_help(self, prog_name, subcommand):
#     def run_from_argv(self, argv):
#     def execute(self, *args, **options):
#     def handle(self, *args, **options):
#     def __init__(self, stdout=None, stderr=None, repo=None):
#     def pre_process(self, repo, **options):
#     def post_process(self, repo, **options):
#     def handle(self, *args, **options):
#     def handle_repo(self, repo, *args, **options):
#     def show_changeset(self, changeset, **options):
#     def get_changesets(self, repo, **options):
#     def handle_repo(self, repo, *args, **options):
#     def iter_changesets(self, repo, changesets, **options):
#     def get_progressbar(self, total, **options):
#     def handle_changeset(self, changeset, **options):
#     def get_changeset(self, **options):
#     def handle_repo(self, repo, *args, **options):
#     def handle_arg(self, changeset, arg, **options):
# 
# Path: vcs/cli.py
# class SingleChangesetCommand(RepositoryCommand):
#     """
#     Single changeset command. Convenient if command has to operate on single
#     changeset rather than whole generator. For usage i.e. with command that
#     handles node(s) from single changeset.
# 
#     **Extra options**
# 
#     * ``min_args``: minimal number of arguements to parse. Default is ``1``.
#     """
# 
#     min_args = 1
# 
#     option_list = RepositoryCommand.option_list + (
#         make_option('-c', '--commit', action='store', dest='changeset_id',
#             default=None, help='Use specific commit. By default we use HEAD/tip'),
#     )
# 
#     def get_changeset(self, **options):
#         """
#         Returns changeset for given ``options``.
#         """
#         cid = options.get('changeset_id', None)
#         return self.repo.get_changeset(cid)
# 
#     def handle_repo(self, repo, *args, **options):
#         if len(args) < self.min_args:
#             raise CommandError("At least %s arguments required" % self.min_args)
#         changeset = self.get_changeset(**options)
#         for arg in args:
#             self.handle_arg(changeset, arg, **options)
# 
#     def handle_arg(self, changeset, arg, **options):
#         """
#         Handles single argument for chosen ``changeset``. Must be implemented at
#         subclass.
# 
#         :param changeset: chosen (by ``--commit`` option) changeset
#         :param arg: single argument from arguments list
#         """
#         raise NotImplementedError()


import os
from vcs.cli import make_option
from vcs.cli import SingleChangesetCommand
            from pygments import highlight
            from pygments.formatters import get_formatter_by_name


class CatCommand(SingleChangesetCommand):
    """
    Writes content of a target file to terminal.
    """

    option_list = SingleChangesetCommand.option_list + (
        make_option('--blame', action='store_true', dest='blame',
            default=False,
            help='Annotate output with '),
        make_option('--plain', action='store_true', dest='plain',
            default=False,
            help='Simply write output to terminal, don\'t use '
                 'any extra formatting/colors (pygments).'),

# Path: vcs/cli.py
# COMPLETION_ENV_NAME = 'VCS_AUTO_COMPLETE'
# class ExecutionManager(object):
# class BaseCommand(object):
# class RepositoryCommand(BaseCommand):
# class ChangesetCommand(RepositoryCommand):
# class SingleChangesetCommand(RepositoryCommand):
#     def __init__(self, argv=None, stdout=None, stderr=None):
#     def get_vcsrc(self):
#     def get_argv_for_command(self):
#     def execute(self):
#     def autocomplete(self):
#     def get_command_class(self, cmd):
#     def get_commands(self):
#     def run_command(self, cmd, argv):
#     def show_help(self):
#     def __init__(self, stdout=None, stderr=None):
#     def get_version(self):
#     def usage(self, subcommand):
#     def get_option_list(self):
#     def get_parser(self, prog_name, subcommand):
#     def print_help(self, prog_name, subcommand):
#     def run_from_argv(self, argv):
#     def execute(self, *args, **options):
#     def handle(self, *args, **options):
#     def __init__(self, stdout=None, stderr=None, repo=None):
#     def pre_process(self, repo, **options):
#     def post_process(self, repo, **options):
#     def handle(self, *args, **options):
#     def handle_repo(self, repo, *args, **options):
#     def show_changeset(self, changeset, **options):
#     def get_changesets(self, repo, **options):
#     def handle_repo(self, repo, *args, **options):
#     def iter_changesets(self, repo, changesets, **options):
#     def get_progressbar(self, total, **options):
#     def handle_changeset(self, changeset, **options):
#     def get_changeset(self, **options):
#     def handle_repo(self, repo, *args, **options):
#     def handle_arg(self, changeset, arg, **options):
# 
# Path: vcs/cli.py
# class SingleChangesetCommand(RepositoryCommand):
#     """
#     Single changeset command. Convenient if command has to operate on single
#     changeset rather than whole generator. For usage i.e. with command that
#     handles node(s) from single changeset.
# 
#     **Extra options**
# 
#     * ``min_args``: minimal number of arguements to parse. Default is ``1``.
#     """
# 
#     min_args = 1
# 
#     option_list = RepositoryCommand.option_list + (
#         make_option('-c', '--commit', action='store', dest='changeset_id',
#             default=None, help='Use specific commit. By default we use HEAD/tip'),
#     )
# 
#     def get_changeset(self, **options):
#         """
#         Returns changeset for given ``options``.
#         """
#         cid = options.get('changeset_id', None)
#         return self.repo.get_changeset(cid)
# 
#     def handle_repo(self, repo, *args, **options):
#         if len(args) < self.min_args:
#             raise CommandError("At least %s arguments required" % self.min_args)
#         changeset = self.get_changeset(**options)
#         for arg in args:
#             self.handle_arg(changeset, arg, **options)
# 
#     def handle_arg(self, changeset, arg, **options):
#         """
#         Handles single argument for chosen ``changeset``. Must be implemented at
#         subclass.
# 
#         :param changeset: chosen (by ``--commit`` option) changeset
#         :param arg: single argument from arguments list
#         """
#         raise NotImplementedError()


# Path: vcs/commands/cat.py
import os
from vcs.cli import make_option
from vcs.cli import SingleChangesetCommand
            from pygments import highlight
            from pygments.formatters import get_formatter_by_name



class CatCommand(SingleChangesetCommand):
    """
    Writes content of a target file to terminal.
    """

    option_list = SingleChangesetCommand.option_list + (
        make_option('--blame', action='store_true', dest='blame',
            default=False,
            help='Annotate output with '),
        make_option('--plain', action='store_true', dest='plain',
            default=False,
            help='Simply write output to terminal, don\'t use '
                 'any extra formatting/colors (pygments).'),

        make_option('-n', '--line-numbers', action='store_true', dest='linenos',