MySQL password changing
[hcoop/domtool2.git] / src / main-dbtool.sml
index 32793d7..a571159 100644 (file)
@@ -40,6 +40,19 @@ val _ =
                        NONE => ()
                      | SOME pass => Main.requestDbUser {dbtype = dbtype, passwd = pass}
                end
                        NONE => ()
                      | SOME pass => Main.requestDbUser {dbtype = dbtype, passwd = pass}
                end
+             | ["passwd"] =>
+               let
+                   val pass = case getpass of
+                                  NONE => NONE
+                                | SOME f =>
+                                  case f () of
+                                      Client.Passwd pass => SOME pass
+                                    | _ => NONE
+               in
+                   case pass of
+                       NONE => ()
+                     | SOME pass => Main.requestDbPasswd {dbtype = dbtype, passwd = pass}
+               end
              | ["createdb", dbname] =>
                if Dbms.validDbname dbname then
                    Main.requestDbTable {dbtype = dbtype, dbname = dbname}
              | ["createdb", dbname] =>
                if Dbms.validDbname dbname then
                    Main.requestDbTable {dbtype = dbtype, dbname = dbname}