aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_io.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-03-02 12:11:06 +0100
committerHans Nilsson <[email protected]>2017-03-02 12:11:06 +0100
commit654f7791bd4c1248ed78401ebeade0f98a2250b3 (patch)
treef95e79faadb151d4cb151592a16d535a8db79276 /lib/ssh/src/ssh_io.erl
parentcf732330c011fb28f58c7e4c043381eac352a9fb (diff)
parent931df53bc431c47140620864b04d4622f9e41421 (diff)
downloadotp-654f7791bd4c1248ed78401ebeade0f98a2250b3.tar.gz
otp-654f7791bd4c1248ed78401ebeade0f98a2250b3.tar.bz2
otp-654f7791bd4c1248ed78401ebeade0f98a2250b3.zip
Merge branch 'hans/ssh/options_freshup/OTP-12872'
Diffstat (limited to 'lib/ssh/src/ssh_io.erl')
-rw-r--r--lib/ssh/src/ssh_io.erl16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/ssh/src/ssh_io.erl b/lib/ssh/src/ssh_io.erl
index 1d8f370884..6828fd4760 100644
--- a/lib/ssh/src/ssh_io.erl
+++ b/lib/ssh/src/ssh_io.erl
@@ -27,17 +27,17 @@
-export([yes_no/2, read_password/2, read_line/2, format/2]).
-include("ssh.hrl").
-read_line(Prompt, Ssh) ->
+read_line(Prompt, Opts) ->
format("~s", [listify(Prompt)]),
- proplists:get_value(user_pid, Ssh) ! {self(), question},
+ ?GET_INTERNAL_OPT(user_pid, Opts) ! {self(), question},
receive
Answer when is_list(Answer) ->
Answer
end.
-yes_no(Prompt, Ssh) ->
+yes_no(Prompt, Opts) ->
format("~s [y/n]?", [Prompt]),
- proplists:get_value(user_pid, Ssh#ssh.opts) ! {self(), question},
+ ?GET_INTERNAL_OPT(user_pid, Opts) ! {self(), question},
receive
%% I can't see that the atoms y and n are ever received, but it must
%% be investigated before removing
@@ -52,15 +52,13 @@ yes_no(Prompt, Ssh) ->
"N" -> no;
_ ->
format("please answer y or n\n",[]),
- yes_no(Prompt, Ssh)
+ yes_no(Prompt, Opts)
end
end.
-
-read_password(Prompt, #ssh{opts=Opts}) -> read_password(Prompt, Opts);
-read_password(Prompt, Opts) when is_list(Opts) ->
+read_password(Prompt, Opts) ->
format("~s", [listify(Prompt)]),
- proplists:get_value(user_pid, Opts) ! {self(), user_password},
+ ?GET_INTERNAL_OPT(user_pid, Opts) ! {self(), user_password},
receive
Answer when is_list(Answer) ->
case trim(Answer) of