def _getopt_flags(options):
 s = []
 l = []
 for o in options:
  if (o.prefix == '-'):
   s.append(o.name)
   if o.takes_argument:
    s.append(':')
  elif o.takes_argument:
   l.append((o.name + '='))
  else:
   l.append(o.name)
 return (''.join(s), l)

def _getopt_flags ( options ) : s = [ ] l = [ ] for o in options : if ( o . prefix == '-' ) : s . append ( o . name ) if o . takes_argument : s . append ( ':' ) elif o . takes_argument : l . append ( ( o . name + '=' ) ) else : l . append ( o . name ) return ( '' . join ( s ) , l )
convert the option list to a getopt flag string and long opt list .