I hear it's useful to tell the difference between failure and success.
in
case (oldpasswd, newpasswd) of
(SOME oldpasswd, SOME newpasswd) =>
in
case (oldpasswd, newpasswd) of
(SOME oldpasswd, SOME newpasswd) =>
- Main.requestPortalPasswdMailbox {domain = domain,
- user = user,
- oldpasswd = String.substring (oldpasswd, 0, size oldpasswd - 1),
- newpasswd = String.substring (newpasswd, 0, size newpasswd - 2)}
+ OS.Process.exit (Main.requestPortalPasswdMailbox {domain = domain,
+ user = user,
+ oldpasswd = String.substring (oldpasswd, 0, size oldpasswd - 1),
+ newpasswd = String.substring (newpasswd, 0, size newpasswd - 1)})
| _ => die "Invalid input"
end
| _ => die "Invalid command-line arguments"
| _ => die "Invalid input"
end
| _ => die "Invalid command-line arguments"
val requestPasswdMailbox : {domain : string, user : string, passwd : string}
-> unit
val requestPortalPasswdMailbox : {domain : string, user : string, oldpasswd : string, newpasswd : string}
val requestPasswdMailbox : {domain : string, user : string, passwd : string}
-> unit
val requestPortalPasswdMailbox : {domain : string, user : string, oldpasswd : string, newpasswd : string}
val requestRmMailbox : {domain : string, user : string} -> unit
val requestSaQuery : string -> unit
val requestRmMailbox : {domain : string, user : string} -> unit
val requestSaQuery : string -> unit
let
val (_, bio) = requestBio (fn () => ())
in
let
val (_, bio) = requestBio (fn () => ())
in
- Msg.send (bio, MsgPortalPasswdMailbox p);
- case Msg.recv bio of
- NONE => print "Server closed connection unexpectedly.\n"
- | SOME m =>
- case m of
- MsgOk => print ("The password for " ^ #user p ^ "@" ^ #domain p ^ " has been changed.\n")
- | MsgError s => print ("Set failed: " ^ s ^ "\n")
- | _ => print "Unexpected server reply.\n";
- OpenSSL.close bio
- end
+ (Msg.send (bio, MsgPortalPasswdMailbox p);
+ case Msg.recv bio of
+ NONE => (print "Server closed connection unexpectedly.\n"; OS.Process.failure)
+ | SOME m =>
+ case m of
+ MsgOk => (print ("The password for " ^ #user p ^ "@" ^ #domain p ^ " has been changed.\n");
+ OS.Process.success)
+ | MsgError s => (print ("Set failed: " ^ s ^ "\n"); OS.Process.failure)
+ | _ => (print "Unexpected server reply.\n"; OS.Process.failure))
+ before OpenSSL.close bio
+ end
fun requestRmMailbox p =
let
fun requestRmMailbox p =
let