\
        Manage the shell stack.
            stack               Display the stack.
            stack <depth>       Exit to the stack by its depth.

def _do_stack(self, cmd, args):
        """\
        Manage the shell stack.
            stack               Display the stack.
            stack <depth>       Exit to the stack by its depth.
        """
        if not args:
            self.__dump_stack()
            return
        if len(args) > 1:
            self.stderr.write('stack: too many arguments: {}\n'.format(args))
            return
        try:
            depth = int(args[0])
        except ValueError:
            self.stderr.write("stack: depth is not an integer: '{}'\n".format(args[0]))
            return
        if depth < 0:
            self.stderr.write('stack: negative depth: {}\n'.format(depth))
            return
        return depth