# Path: servi/command.py
# class Command(object):
#     def __init__(self):
#         self.special = {
#             "skip_init": False,
#             "parse_known_args": False
#         }
# 
#     def register_command_line(self, sub_parser):
#         pass
# 
#     def run(self, args, extra_args):
#         pass


import os
import json
import servi.config as c
from pprint import pformat
from servi.command import Command
        self.parser = None

    # noinspection PyProtectedMember
    def register_command_line(self, sub_parsers):

        #
        # Note - this is as-defined by ansible:
        # http://docs.ansible.com/developing_inventory.html
        #
        parser = sub_parsers.add_parser(
            'inventory', help='Print ansible inventory to stdout',
            description='Print ansible inventory to stdout.  The data '
                        'for the inventory comes from Servifile_globals.yml.  '
                        'This is used by the servi_inventory script.')

        parser.add_argument(
            '--list',  action='store_true',
            help='List all hosts')

        parser.add_argument(
            '--host', type=str,
            help='List specific host')

        parser.add_argument(
            '--debug', action="store_true",
            help="Debug your HOSTS record.")

        parser.set_defaults(command_func=self.run)

        self.parser = parser

# Path: servi/command.py
# class Command(object):
#     def __init__(self):
#         self.special = {
#             "skip_init": False,
#             "parse_known_args": False
#         }
# 
#     def register_command_line(self, sub_parser):
#         pass
# 
#     def run(self, args, extra_args):
#         pass


# Path: servi/commands/inventory.py
import os
import json
import servi.config as c
from pprint import pformat
from servi.command import Command

        self.parser = None

    # noinspection PyProtectedMember
    def register_command_line(self, sub_parsers):

        #
        # Note - this is as-defined by ansible:
        # http://docs.ansible.com/developing_inventory.html
        #
        parser = sub_parsers.add_parser(
            'inventory', help='Print ansible inventory to stdout',
            description='Print ansible inventory to stdout.  The data '
                        'for the inventory comes from Servifile_globals.yml.  '
                        'This is used by the servi_inventory script.')

        parser.add_argument(
            '--list',  action='store_true',
            help='List all hosts')

        parser.add_argument(
            '--host', type=str,
            help='List specific host')

        parser.add_argument(
            '--debug', action="store_true",
            help="Debug your HOSTS record.")

        parser.set_defaults(command_func=self.run)

        self.parser = parser

        self.arglist = [arg.dest for arg in parser._optionals._actions