#!/usr/bin/env python
import logging
import argparse
from matador.session import Session


class Command(object):

    def __init__(self):
        parser = argparse.ArgumentParser(
            description="Taming the bull: Change management for Agresso systems")
        self._logger = logging.getLogger(__name__)
        self._add_arguments(parser)
        self.args, unknown = parser.parse_known_args()
        Session.initialise_session()
        self._execute()

    def _add_arguments(self, parser):
        pass

    def _execute(self):
        raise NotImplementedError

@@ -125,27 +125,466 @@
 _init__(self
+, **kwargs
 ):%0A
+        if kwargs:%0A        # If kwargs have been supplied, use these in same way argsparse would.%0A        # Mainly used for testing.%0A            class Args(object):%0A                pass%0A%0A            self.args = Args()%0A            for key, value in kwargs.items():%0A                setattr(self.args, key, value)%0A        else:%0A        # If the command is created from the command line, we'll have arguments%0A        # to parse.%0A    
         pars
@@ -613,16 +613,20 @@
 Parser(%0A
+    
         
@@ -707,55 +707,8 @@
     
-    self._logger = logging.getLogger(__name__)%0A
     
@@ -739,16 +739,20 @@
 parser)%0A
+    
         
@@ -793,24 +793,76 @@
 known_args()
+%0A%0A        self._logger = logging.getLogger(__name__)
 %0A        Ses

Add kwargs to command init for testing