From: Clinton Ebadi Date: Mon, 6 Oct 2014 03:13:06 +0000 (-0400) Subject: client: function to check if stdin is a tty X-Git-Tag: release_20141005^2~4 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/0e6bfb3cba2e80bf14ca59c14ef57c35d138d892 client: function to check if stdin is a tty --- diff --git a/src/client.sig b/src/client.sig index 8cf8cd4..4b4b571 100644 --- a/src/client.sig +++ b/src/client.sig @@ -24,6 +24,8 @@ signature CLIENT = sig | Aborted | Error + val hastty : unit -> bool + val getpass : unit -> passwd_result (* Standard non-echoed console password input with confirmation *) end diff --git a/src/client.sml b/src/client.sml index 0c4112f..a92b13f 100644 --- a/src/client.sml +++ b/src/client.sml @@ -25,6 +25,9 @@ datatype passwd_result = | Aborted | Error +fun hastty () = + Posix.ProcEnv.isatty Posix.FileSys.stdin + fun getpass () = let val tty = Posix.FileSys.stdin