summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-12-12 10:44:19 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-12-12 10:44:19 -0500
commitf52635b782fab64b3ef306da22ad3eb7eeeaabfe (patch)
treea4f8a6807bc7c0fa9edf44842288e16bec12cd3b
parent805a3eda8adf0482ea539dadc7e6c745056a04a8 (diff)
-prefix command-line option
-rw-r--r--doc/manual.tex2
-rw-r--r--src/compiler.sml2
-rw-r--r--src/main.mlton.sml3
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)