<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _add_cli_scripts(self):
        '''Add the found external sections to the templ_dict.'''

        pattern = r"cli script\s+" \
                  r"(\/[\w\.\-]+\/)?" \
                  r"(?P<name>[\w\.\-]+)\s*\{"
        sections = re.finditer(pattern, self.template_str)

        for section in sections:
            if 'scripts' not in self.templ_dict:
                self.templ_dict['scripts'] = []

            try:
                sec_start = self._get_section_start_index(
                    section.group('name')
                )
            except NonextantSectionException:
                continue

            sec_end = self._get_section_end_index(
                section.group('name'), sec_start
            )
            section_value = self.template_str[sec_start+1:sec_end].strip()

            self.templ_dict['scripts'].append(dict(
                name=section.group('name'),
                script=section_value
            ))

            self.template_str = self.template_str[:sec_start+1] + \
                self.template_str[sec_end:]