def parse_cli(arg_list=None, origin=os.getcwd(), arg_parser=None, key_value_delimiters=('=', ':'), comment_seperators=(), key_delimiters=(',',), section_override_delimiters=('.',)):
 arg_parser = (default_arg_parser() if (arg_parser is None) else arg_parser)
 origin += os.path.sep
 sections = OrderedDict(default=Section('Default'))
 line_parser = LineParser(key_value_delimiters, comment_seperators, key_delimiters, {}, section_override_delimiters)
 for (arg_key, arg_value) in sorted(vars(arg_parser.parse_args(arg_list)).items()):
  if ((arg_key == 'settings') and (arg_value is not None)):
   parse_custom_settings(sections, arg_value, origin, line_parser)
  else:
   if isinstance(arg_value, list):
    arg_value = ','.join([str(val) for val in arg_value])
   append_to_sections(sections, arg_key, arg_value, origin, from_cli=True)
 return sections

def parse_cli ( arg_list = None , origin = os . getcwd ( ) , arg_parser = None , key_value_delimiters = ( '=' , ':' ) , comment_seperators = ( ) , key_delimiters = ( ',' , ) , section_override_delimiters = ( '.' , ) ) : arg_parser = ( default_arg_parser ( ) if ( arg_parser is None ) else arg_parser ) origin += os . path . sep sections = OrderedDict ( default = Section ( 'Default' ) ) line_parser = LineParser ( key_value_delimiters , comment_seperators , key_delimiters , { } , section_override_delimiters ) for ( arg_key , arg_value ) in sorted ( vars ( arg_parser . parse_args ( arg_list ) ) . items ( ) ) : if ( ( arg_key == 'settings' ) and ( arg_value is not None ) ) : parse_custom_settings ( sections , arg_value , origin , line_parser ) else : if isinstance ( arg_value , list ) : arg_value = ',' . join ( [ str ( val ) for val in arg_value ] ) append_to_sections ( sections , arg_key , arg_value , origin , from_cli = True ) return sections
parses the cli arguments and creates sections out of it .