Permalink
Browse files

Merge branch 'master' of git://github.com/mochi/mochiweb

  • Loading branch information...
RJ committed Dec 27, 2010
2 parents 399cd81 + c70d473 commit 471264d1cbfdc0fc678326b1f70a4f5e33518f43
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/mochiweb_util.erl
View
@@ -9,7 +9,7 @@
-export([path_split/1]).
-export([urlsplit/1, urlsplit_path/1, urlunsplit/1, urlunsplit_path/1]).
-export([guess_mime/1, parse_header/1]).
--export([shell_quote/1, cmd/1, cmd_string/1, cmd_port/2, cmd_status/1]).
+-export([shell_quote/1, cmd/1, cmd_string/1, cmd_port/2, cmd_status/1, cmd_status/2]).
-export([record_to_proplist/2, record_to_proplist/3]).
-export([safe_relative_path/1, partition/2]).
-export([parse_qvalues/1, pick_accepted_encodings/3]).
@@ -118,11 +118,17 @@ cmd_string(Argv) ->
string:join([shell_quote(X) || X <- Argv], " ").
%% @spec cmd_status([string()]) -> {ExitStatus::integer(), Stdout::binary()}
-%% @doc Accumulate the output and exit status from the given application, will be
-%% spawned with cmd_port/2.
+%% @doc Accumulate the output and exit status from the given application,
+%% will be spawned with cmd_port/2.
cmd_status(Argv) ->
+ cmd_status(Argv, []).
+
+%% @spec cmd_status([string()], [atom()]) -> {ExitStatus::integer(), Stdout::binary()}
+%% @doc Accumulate the output and exit status from the given application,
+%% will be spawned with cmd_port/2.
+cmd_status(Argv, Options) ->
Port = cmd_port(Argv, [exit_status, stderr_to_stdout,
- use_stdio, binary]),
+ use_stdio, binary | Options]),
try cmd_loop(Port, [])
after catch port_close(Port)
end.

0 comments on commit 471264d

Please sign in to comment.