summaryrefslogtreecommitdiff
path: root/src/manual/scala/man1/scala.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-06-12 14:18:13 +0000
committermichelou <michelou@epfl.ch>2006-06-12 14:18:13 +0000
commit1c43cfe216a0d759568a964a16345ea773f32211 (patch)
treecc9c93e37b6817c14e1334d910b9012e408c85b8 /src/manual/scala/man1/scala.scala
parentde843e4a74769be951e28d7f744dc812e3eed83e (diff)
downloadscala-1c43cfe216a0d759568a964a16345ea773f32211.tar.gz
scala-1c43cfe216a0d759568a964a16345ea773f32211.tar.bz2
scala-1c43cfe216a0d759568a964a16345ea773f32211.zip
moved docs/man/src to src/manual and updated bu...
moved docs/man/src to src/manual and updated build.xml
Diffstat (limited to 'src/manual/scala/man1/scala.scala')
-rw-r--r--src/manual/scala/man1/scala.scala148
1 files changed, 148 insertions, 0 deletions
diff --git a/src/manual/scala/man1/scala.scala b/src/manual/scala/man1/scala.scala
new file mode 100644
index 0000000000..827bd09cb2
--- /dev/null
+++ b/src/manual/scala/man1/scala.scala
@@ -0,0 +1,148 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2006 LAMP/EPFL
+ * @author Stephane Micheloud
+ */
+//$Id: $
+
+package scala.man1
+
+object scala extends Command {
+ import _root_.scala.tools.docutil.ManPage._
+
+ protected def cn = new Error().getStackTrace()(0).getClassName()
+
+ val name = Section("NAME",
+
+ MBold(command) & " " & NDash & " Launcher for the " &
+ Link("Scala 2", "http://scala.epfl.ch/") & " language")
+
+ val synopsis = Section("SYNOPSIS",
+
+ CmdLine(" [ " & Argument("options") & " ] " &
+ Argument("class file") & " [ " & Argument("args") & " ]"))
+
+ val parameters = Section("PARAMETERS",
+
+ DefinitionList(
+ Definition(
+ Mono(Argument("options")),
+ "Command line options. See " & Link(Bold("OPTIONS"), "#options") &
+ " below."),
+ Definition(
+ Mono(Argument("class file")),
+ "Name of the class to be invoked."),
+ Definition(
+ Mono(Argument("args")),
+ "Program arguments passed to the main function.")))
+
+ val description = Section("DESCRIPTION",
+
+ "The " & MBold(command) & " utility launches a Scala application. " &
+ "It does this by starting a Java runtime environment, loading a " &
+ "specified class, and invoking that class's " & Bold("main") &
+ " method. The method must have the following signature:",
+
+ BlockQuote(Mono(Bold("def") & " main(args: Array[String]): Unit")),
+
+ "The method must return a " & Bold("Unit") & " value, and it must " &
+ "accept a " & Bold("String") & " array as a parameter. By default, " &
+ "the first non-option argument is the name of the class to be invoked. "&
+ "A fully-qualified class name should be used.",
+
+ "The Scala runtime searches for the startup class, and other classes " &
+ "used, in three sets of locations: the bootstrap class path, the " &
+ "installed extensions, and the user class path.")
+
+ val options = Section("OPTIONS",
+
+ "The launcher has a set of standard options that are supported on the " &
+ "current runtime environment and will be supported in future releases. " &
+ "An additional set of non-standard options are specific to the current " &
+ "virtual machine implementation and are subject to change in the future. " &
+ "Non-standard options begin with " & CmdOption("X") & ".",
+
+ Section("Standard Options",
+ DefinitionList(
+ Definition(
+ CmdOption("cp") & "| " & CmdOption("classpath", Argument("path")),
+ "Specify where to find user class files (on Unix-based systems " &
+ "a colon-separated list of paths, on Windows-based systems, a " &
+ "semicolon-separate list of paths)."),
+ Definition(
+ CmdOption("D", Argument("name") & "=" & Argument("value")),
+ "Set a system property."),
+ Definition(
+ CmdOption("verbose", "[:class|gc|jni]"),
+ "Enable verbose output."),
+ Definition(
+ CmdOption("showversion"),
+ "Print product version and continue."),
+ Definition(
+ CmdOption("version"),
+ "Print product version and exit."),
+ Definition(
+ CmdOption("help"),
+ "Print this help message."))),
+
+ Section("Non-Standard Options",
+ "Same options as the " & MBold("java") & " command."))
+
+ val environment = Section("ENVIRONMENT",
+
+ DefinitionList(
+ Definition(
+ MBold("JAVACMD"),
+ "Specify the " & MBold("java") & " command to be used " &
+ "for running the Scala commands")))
+
+ val examples = Section("EXAMPLES",
+
+ DefinitionList(
+ Definition(
+ "Execute a Scala program generated in the current directory",
+ CmdLine("hello.HelloWorld")),
+ Definition(
+ "Execute a Scala program generated in a user-defined " &
+ "directory " & Bold("classes"),
+ CmdLine(CmdOption("classpath", "classes") & "hello.HelloWorld")),
+ Definition(
+ "Execute a Scala program using a user-defined " & MBold("java") & " " &
+ "command",
+ MBold("env JAVACMD") & Mono("=/usr/local/bin/cacao ") &
+ CmdLine(CmdOption("classpath", "classes") & "hello.HelloWorld"))))
+
+ val exitStatus = Section("EXIT STATUS",
+
+ MBold(command) & " returns a zero exit status if it succeeds. " &
+ "Non zero is returned in case of failure.")
+
+ val seeAlso = Section("SEE ALSO",
+
+ Link(Bold("sbaz") & "(1)", "sbaz.html") & ", " &
+ Link(Bold("scalac") & "(1)", "scalac.html") & ", " &
+ Link(Bold("scaladoc") & "(1)", "scaladoc.html") & ", " &
+ Link(Bold("scalaint") & "(1)", "scalaint.html") & ", " &
+ Link(Bold("scalap") & "(1)", "scalap.html") & ", " &
+ Link(Bold("scalascript") & "(1)", "scalascript.html"))
+
+ def manpage = new Document {
+ title = command
+ date = lastModified
+ author = "Stephane Micheloud"
+ version = "0.2"
+ sections = List(
+ name,
+ synopsis,
+ parameters,
+ description,
+ options,
+ environment,
+ examples,
+ exitStatus,
+ authors,
+ bugs,
+ copyright,
+ seeAlso)
+ }
+}
+