Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/main/cm-boot.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/main/cm-boot.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1594, Fri Aug 6 20:38:58 2004 UTC revision 1595, Fri Aug 6 23:07:17 2004 UTC
# Line 739  Line 739 
739              fun badopt opt f () =              fun badopt opt f () =
740                  Say.say ["!* bad ", opt, " option: `", f, "'\n",                  Say.say ["!* bad ", opt, " option: `", f, "'\n",
741                           "!* try `-h' or `-h<level>' for help\n"]                           "!* try `-h' or `-h<level>' for help\n"]
742              fun carg (opt as ("-C" | "-D"), f, _) =  
743                fun quit () = OS.Process.exit OS.Process.success
744    
745                fun quit_if true = quit ()
746                  | quit_if false = ()
747    
748                fun carg (opt as ("-C" | "-D"), f, _, _) =
749                  let val bad = badopt opt f                  let val bad = badopt opt f
750                      val spec = Substring.extract (f, 2, NONE)                      val spec = Substring.extract (f, 2, NONE)
751                      val is_config = opt = "-C"                      val is_config = opt = "-C"
# Line 773  Line 779 
779                                SOME i => #set (SSV.symval name) (SOME i)                                SOME i => #set (SSV.symval name) (SOME i)
780                              | NONE => bad ())                              | NONE => bad ())
781                  end                  end
782                | carg ("-U", f, _) =                | carg ("-U", f, _, _) =
783                  (case String.extract (f, 2, NONE) of                  (case String.extract (f, 2, NONE) of
784                       "" => badopt "-U" f ()                       "" => badopt "-U" f ()
785                     | var => #set (SSV.symval var) NONE)                     | var => #set (SSV.symval var) NONE)
786                | carg ("-h", f, _) =                | carg ("-h", f, _, last) =
787                  (case String.extract (f, 2, NONE) of                  (case String.extract (f, 2, NONE) of
788                       "" => help (SOME 0)                       "" => help (SOME 0)
789                     | level => help (Int.fromString level))                       | level => help (Int.fromString level);
790                | carg ("-s", f, _) =                     quit_if last)
791                  | carg ("-s", f, _, last) =
792                  (case String.extract (f, 2, NONE) of                  (case String.extract (f, 2, NONE) of
793                       "" => showcur (SOME 0)                       "" => showcur (SOME 0)
794                     | level => showcur (Int.fromString level))                       | level => showcur (Int.fromString level);
795                | carg (_, f, mk) = p (f, mk,                     quit_if last)
796                                   String.map Char.toLower                | carg (_, f, mk, _) =
797                      p (f, mk, String.map Char.toLower
798                                              (getOpt (OS.Path.ext f, "<none>")))                                              (getOpt (OS.Path.ext f, "<none>")))
799    
800              fun args ("-a" :: rest, _) = args (rest, autoload)              fun args ("-a" :: rest, _) = args (rest, autoload)
801                | args ("-m" :: rest, _) = args (rest, make)                | args ("-m" :: rest, _) = args (rest, make)
802                | args ("-H" :: rest, mk) = (help NONE; args (rest, mk))                | args ("-H" :: rest, mk) = (help NONE; args_q (rest, mk))
803                | args ("-S" :: rest, mk) = (showcur NONE; args (rest, mk))                | args ("-S" :: rest, mk) = (showcur NONE; args_q (rest, mk))
804                  | args ("-q" :: _, _) = quit ()
805                | args ("@CMbuild" :: rest, _) = mlbuild rest                | args ("@CMbuild" :: rest, _) = mlbuild rest
806                | args (f :: rest, mk) =                | args (f :: rest, mk) =
807                  (carg (String.substring (f, 0, 2), f, mk)                  (carg (String.substring (f, 0, 2)
808                   handle General.Subscript => ();                           handle General.Subscript => "",
809                           f, mk, List.null rest);
810                   args (rest, mk))                   args (rest, mk))
811                | args ([], _) = ()                | args ([], _) = ()
812    
813                and args_q ([], _) = quit ()
814                  | args_q (rest, f) = args (rest, f)
815          in          in
816              case SMLofNJ.getArgs () of              case SMLofNJ.getArgs () of
817                  ["@CMslave"] => (#set StdConfig.verbose false; slave ())                  ["@CMslave"] => (#set StdConfig.verbose false; slave ())

Legend:
Removed from v.1594  
changed lines
  Added in v.1595

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0