def run_env_command(command, prefix, *arguments):
 p = create_parser()
 prefix = escape_for_winpath(prefix)
 if arguments:
  arguments = list(map(escape_for_winpath, arguments))
 if (command is Commands.ENV_EXPORT):
  command_line = '{0} -n {1} {2}'.format(command, prefix, ' '.join(arguments))
 elif (command is Commands.ENV_CREATE):
  if prefix:
   command_line = '{0} -f {1}  {2}'.format(command, prefix, ' '.join(arguments))
  else:
   command_line = '{0} '.format(command)
 elif (command is Commands.ENV_REMOVE):
  command_line = '{0} --yes -n {1} {2}'.format(command, prefix, ' '.join(arguments))
 elif (command is Commands.ENV_UPDATE):
  command_line = '{0} -n {1} {2}'.format(command, prefix, ' '.join(arguments))
 else:
  command_line = ' --help '
 args = p.parse_args(split(command_line))
 context._set_argparse_args(args)
 with captured() as c:
  args.func(args, p)
 return (c.stdout, c.stderr)

def run_env_command ( command , prefix , * arguments ) : p = create_parser ( ) prefix = escape_for_winpath ( prefix ) if arguments : arguments = list ( map ( escape_for_winpath , arguments ) ) if ( command is Commands . ENV_EXPORT ) : command_line = '{0} -n {1} {2}' . format ( command , prefix , ' ' . join ( arguments ) ) elif ( command is Commands . ENV_CREATE ) : if prefix : command_line = '{0} -f {1}  {2}' . format ( command , prefix , ' ' . join ( arguments ) ) else : command_line = '{0} ' . format ( command ) elif ( command is Commands . ENV_REMOVE ) : command_line = '{0} --yes -n {1} {2}' . format ( command , prefix , ' ' . join ( arguments ) ) elif ( command is Commands . ENV_UPDATE ) : command_line = '{0} -n {1} {2}' . format ( command , prefix , ' ' . join ( arguments ) ) else : command_line = ' --help ' args = p . parse_args ( split ( command_line ) ) context . _set_argparse_args ( args ) with captured ( ) as c : args . func ( args , p ) return ( c . stdout , c . stderr )
run conda env commands args: command: the command .