# Path: yoda/version.py
# def get_version():
#     """Get version from package resources."""
#     requirement = pkg_resources.Requirement.parse("yoda")
#     provider = pkg_resources.get_provider(requirement)
#     return provider.version


import argparse
from yoda.version import get_version
            dest="subcommand",
            metavar="[subcommand]")

        self.__generic_arguments(self.parser)

    def add_command(self, command):
        command_name = command.__class__.__name__.lower()
        command.setup(command_name, self.config, self.subparser)
        self.commands[command_name] = command

    def parse(self):
        for key, command in self.commands.items():
            command.parse()

    def execute(self, args):
        if args.subcommand is None:
            self.parser.print_help()
            return None

        if (args.subcommand in self.commands):
            self.commands[args.subcommand].execute(args)

    def __generic_arguments(self, parser):
        parser.add_argument(
            "-d", "--debug",
            action="store_true",
            help="show debug informations")
        parser.add_argument(
            "--version",
            action="version",

# Path: yoda/version.py
# def get_version():
#     """Get version from package resources."""
#     requirement = pkg_resources.Requirement.parse("yoda")
#     provider = pkg_resources.get_provider(requirement)
#     return provider.version


# Path: yoda/subcommands.py
import argparse
from yoda.version import get_version

            dest="subcommand",
            metavar="[subcommand]")

        self.__generic_arguments(self.parser)

    def add_command(self, command):
        command_name = command.__class__.__name__.lower()
        command.setup(command_name, self.config, self.subparser)
        self.commands[command_name] = command

    def parse(self):
        for key, command in self.commands.items():
            command.parse()

    def execute(self, args):
        if args.subcommand is None:
            self.parser.print_help()
            return None

        if (args.subcommand in self.commands):
            self.commands[args.subcommand].execute(args)

    def __generic_arguments(self, parser):
        parser.add_argument(
            "-d", "--debug",
            action="store_true",
            help="show debug informations")
        parser.add_argument(
            "--version",
            action="version",

            version="%(prog)s {}".format(get_version()))