support arbitrary command nesting