'end the most recently created command group by popping it from the
group stack. groups are created by visitcommand or a nested command'

def endcommand(self):

    assert (len(self.groupstack) >= 2), 'groupstack    must    contain    shell    and    command    groups'
    g = self.groupstack.pop()
    logger.info('ending    group    %s', g)
