def METHOD_NAME(self, cmdclass, args, makedirs=False):
    """
    Create a new command object, creating the necessary arguments.  The
    cmdclass argument is the Command class, and args is the args dict
    to pass to its constructor.
    This always creates the FakeProtocolCommand with a basedir (self.basedir).
    If makedirs is true, it will create the basedir and a workdir directory
    inside (named 'workdir').
    The resulting command is returned, but as a side-effect, the following
    attributes are set:
        self.cmd -- the command
    """
    # set up the workdir and basedir
    if makedirs:
        basedir_abs = os.path.abspath(os.path.join(self.basedir))
        workdir_abs = os.path.abspath(
            os.path.join(self.basedir, 'workdir'))
        if os.path.exists(basedir_abs):
            shutil.rmtree(basedir_abs)
        os.makedirs(workdir_abs)
    self.protocol_command = FakeProtocolCommand(basedir=self.basedir)
    self.cmd = cmdclass(self.protocol_command, 'fake-stepid', args)
    return self.cmd