def RegenerateAppendFlag(flag, values, predicate, env_name, options):
 flags = []
 if (options.use_environment and env_name):
  for flag_value in ShlexEnv(env_name):
   value = FormatOpt(flag, predicate(flag_value))
   if (value in flags):
    flags.remove(value)
   flags.append(value)
 if values:
  for flag_value in values:
   flags.append(FormatOpt(flag, predicate(flag_value)))
 return flags

def RegenerateAppendFlag ( flag , values , predicate , env_name , options ) : flags = [ ] if ( options . use_environment and env_name ) : for flag_value in ShlexEnv ( env_name ) : value = FormatOpt ( flag , predicate ( flag_value ) ) if ( value in flags ) : flags . remove ( value ) flags . append ( value ) if values : for flag_value in values : flags . append ( FormatOpt ( flag , predicate ( flag_value ) ) ) return flags
regenerate a list of command line flags .