def gscommand(self, command):
        """
        Runs the command with the given args.
        """
        args = split(command)

        self.cli.args = args[1:]

        patches = (
            patch.object(sys, 'stdout'),
            patch.object(sys, 'stderr'))

        with nested(*patches):
            stdout = sys.stdout
            stderr = sys.stderr
            try:
                self.cli.run()
            except SystemExit as se:
                pass

        stdout = ''.join([i[0][0] for i in stdout.write.call_args_list])
        stderr = ''.join([i[0][0] for i in stderr.write.call_args_list])

        return (se.code, stdout, stderr)

        Runs the command with the given args.
        
src/gitsweep/tests/testcases.py