comparison src/main.mlton.sml @ 1126:c01fb6f1b31f

-path and -root command-line flags
author Adam Chlipala <adamc@hcoop.net>
date Tue, 12 Jan 2010 11:07:39 -0500
parents bed675db3aff
children 8679ba87cf3c
comparison
equal deleted inserted replaced
1125:e06bfeb6c2aa 1126:c01fb6f1b31f
1 (* Copyright (c) 2008, Adam Chlipala 1 (* Copyright (c) 2008-2010, Adam Chlipala
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
64 (Settings.setSql (SOME s); 64 (Settings.setSql (SOME s);
65 doArgs rest) 65 doArgs rest)
66 | "-static" :: rest => 66 | "-static" :: rest =>
67 (Settings.setStaticLinking true; 67 (Settings.setStaticLinking true;
68 doArgs rest) 68 doArgs rest)
69 | "-path" :: name :: path :: rest =>
70 (Compiler.addPath (name, path);
71 doArgs rest)
72 | "-root" :: name :: root :: rest =>
73 (Compiler.addModuleRoot (root, name);
74 doArgs rest)
69 | arg :: rest => 75 | arg :: rest =>
70 (if size arg > 0 andalso String.sub (arg, 0) = #"-" then 76 (if size arg > 0 andalso String.sub (arg, 0) = #"-" then
71 raise Fail ("Unknown flag " ^ arg) 77 raise Fail ("Unknown flag " ^ arg)
72 else 78 else
73 sources := arg :: !sources; 79 sources := arg :: !sources;