diff options
-rw-r--r-- | doc/manual.tex | 2 | ||||
-rw-r--r-- | src/compiler.sml | 2 | ||||
-rw-r--r-- | src/main.mlton.sml | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/doc/manual.tex b/doc/manual.tex index e48c2648..2509439a 100644 --- a/doc/manual.tex +++ b/doc/manual.tex @@ -238,6 +238,8 @@ sqlite3 path/to/database/file <app.sql \item \texttt{-path NAME VALUE}: Set the value of path variable \texttt{\$NAME} to \texttt{VALUE}, for use in \texttt{.urp} files. +\item \texttt{-prefix PREFIX}: Equivalent to the \texttt{prefix} directive from \texttt{.urp} files + \item \texttt{-protocol [http|cgi|fastcgi]}: Set the protocol that the generated application speaks. \begin{itemize} \item \texttt{http}: This is the default. It is for building standalone web servers that can be accessed by web browsers directly. diff --git a/src/compiler.sml b/src/compiler.sml index 655f8ced..10a63d51 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -445,7 +445,7 @@ fun parseUrp' accLibs fname = readSources acc end - val prefix = ref NONE + val prefix = ref (case Settings.getUrlPrefix () of "/" => NONE | s => SOME s) val database = ref (Settings.getDbstring ()) val exe = ref (Settings.getExe ()) val sql = ref (Settings.getSql ()) diff --git a/src/main.mlton.sml b/src/main.mlton.sml index a434ef12..06c04366 100644 --- a/src/main.mlton.sml +++ b/src/main.mlton.sml @@ -46,6 +46,9 @@ fun doArgs args = | "-protocol" :: name :: rest => (Settings.setProtocol name; doArgs rest) + | "-prefix" :: prefix :: rest => + (Settings.setUrlPrefix prefix; + doArgs rest) | "-db" :: s :: rest => (Settings.setDbstring (SOME s); doArgs rest) |