# 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

class Subcommands:
    config = None
    parser = None
    subparser = None
    commands = {}

    def __init__(self, config):
        self.config = config
        self.parser = argparse.ArgumentParser(
            prog="Yoda",
            description="""Manage your repositories easier.
            Each workspaces are subcommands,
            type `yoda workspace_name -h` to show help.""")

        self.subparser = self.parser.add_subparsers(
            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()


# 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


class Subcommands:
    config = None
    parser = None
    subparser = None
    commands = {}

    def __init__(self, config):
        self.config = config
        self.parser = argparse.ArgumentParser(
            prog="Yoda",
            description="""Manage your repositories easier.
            Each workspaces are subcommands,
            type `yoda workspace_name -h` to show help.""")

        self.subparser = self.parser.add_subparsers(
            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):