added fsc to the man pages
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@8098 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
7e709e613b
commit
707fce7e0b
|
@ -703,6 +703,7 @@ DOCUMENTATION
|
|||
classpathref="manual.classpath">
|
||||
<include name="**/*.scala"/>
|
||||
</quick>
|
||||
<emit command="fsc"/>
|
||||
<emit command="sbaz"/>
|
||||
<emit command="scala"/>
|
||||
<emit command="scalac"/>
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
/* NSC -- new Scala compiler
|
||||
* Copyright 2005-2006 LAMP/EPFL
|
||||
* @author Stephane Micheloud
|
||||
*/
|
||||
//$Id: $
|
||||
|
||||
package scala.man1
|
||||
|
||||
object fsc extends Command {
|
||||
import _root_.scala.tools.docutil.ManPage._
|
||||
|
||||
protected def cn = new Error().getStackTrace()(0).getClassName()
|
||||
|
||||
val name = Section("NAME",
|
||||
|
||||
MBold(command) & " " & NDash & " Offline compiler for the " &
|
||||
Link("Scala 2", "http://scala.epfl.ch/") & " language")
|
||||
|
||||
val synopsis = Section("SYNOPSIS",
|
||||
|
||||
CmdLine(" [ " & Argument("options") & " ] " &
|
||||
Argument("source files")))
|
||||
|
||||
val parameters = scalac.parameters
|
||||
|
||||
val description = Section("DESCRIPTION",
|
||||
|
||||
"The " & MBold(command) & " tool reads class and object definitions, " &
|
||||
"written in the Scala programming language, and compiles them into " &
|
||||
"bytecode class files.",
|
||||
|
||||
"By default, the compiler puts each class file in the same directory " &
|
||||
"as its source file. You can specify a separate destination directory " &
|
||||
"with -d (see " & Link(Bold("OPTIONS"), "#options") & ", below).")
|
||||
|
||||
val options =
|
||||
Section("Standard Options",
|
||||
DefinitionList(
|
||||
Definition(
|
||||
CmdOption("reset"),
|
||||
"Reset compile server caches"),
|
||||
Definition(
|
||||
CmdOption("shutdown"),
|
||||
"Shutdown compile server"),
|
||||
Definition(
|
||||
CmdOption("server", Argument("hostname:portnumber")),
|
||||
"Specify compile server socket"),
|
||||
Definition(
|
||||
CmdOption("J", Argument("flag")),
|
||||
"Pass <flag> directly to runtime system")
|
||||
))
|
||||
|
||||
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(
|
||||
"Compile a Scala program to the current directory",
|
||||
CmdLine("HelloWorld")),
|
||||
Definition(
|
||||
"Compile a Scala program to the destination directory " &
|
||||
MBold("classes"),
|
||||
CmdLine(CmdOption("d", "classes") & "HelloWorld.scala")),
|
||||
Definition(
|
||||
"Compile a Scala program using a user-defined " & MBold("java") & " " &
|
||||
"command",
|
||||
MBold("env JAVACMD") & Mono("=/usr/local/bin/cacao ") &
|
||||
CmdLine(CmdOption("d", "classes") & "HelloWorld.scala")),
|
||||
Definition(
|
||||
"Compile all Scala files found in the source directory " &
|
||||
MBold("src") & " to the destination directory " &
|
||||
MBold("classes"),
|
||||
CmdLine(CmdOption("d", "classes") & "src/*.scala"))))
|
||||
|
||||
val exitStatus = Section("EXIT STATUS",
|
||||
|
||||
MBold(command) & " returns a zero exist status if it succeeds to " &
|
||||
"compile the specified input files. Non zero is returned in case " &
|
||||
"of failure.")
|
||||
|
||||
val seeAlso = Section("SEE ALSO",
|
||||
|
||||
Link(Bold("sbaz") & "(1)", "sbaz.html") & ", " &
|
||||
Link(Bold("scala") & "(1)", "scala.html") & ", " &
|
||||
Link(Bold("scalac") & "(1)", "scalac.html") & ", " &
|
||||
Link(Bold("scaladoc") & "(1)", "scaladoc.html") & ", " &
|
||||
Link(Bold("scalap") & "(1)", "scalap.html"))
|
||||
|
||||
def manpage = new Document {
|
||||
title = command
|
||||
date = lastModified // e.g. "June 8, 2006"
|
||||
author = "Stephane Micheloud"
|
||||
version = "0.1"
|
||||
sections = List(
|
||||
name,
|
||||
synopsis,
|
||||
parameters,
|
||||
options,
|
||||
environment,
|
||||
examples,
|
||||
exitStatus,
|
||||
authors,
|
||||
bugs,
|
||||
copyright,
|
||||
seeAlso)
|
||||
}
|
||||
}
|
|
@ -32,7 +32,7 @@ object scala extends Command {
|
|||
Mono(Argument("compiler-option")),
|
||||
"Options for the compiler. See " &
|
||||
Link(Bold("scalac") & "(1)", "scalac.html") & "."),
|
||||
|
||||
|
||||
Definition(
|
||||
Mono("-howtorun:") & Argument("how"),
|
||||
"How to execute " & Argument("torun") & ", if it is present. " &
|
||||
|
@ -43,7 +43,7 @@ object scala extends Command {
|
|||
Definition(
|
||||
Mono(Argument("torun")),
|
||||
"A top-level object or a script file to run."),
|
||||
|
||||
|
||||
Definition(
|
||||
Mono(Argument("argument")),
|
||||
"An arguments to pass to " & Argument("torun") & ".")))
|
||||
|
@ -53,35 +53,34 @@ object scala extends Command {
|
|||
"The "&MBold(command)&" utility runs Scala code using a Java runtime "&
|
||||
"environment. The Scala code to run is " &
|
||||
"specified in one of three ways:",
|
||||
|
||||
|
||||
NumberedList(
|
||||
"With no arguments specified, an interactive interpreter starts " &
|
||||
"and reads commands interactively.",
|
||||
|
||||
|
||||
"With " & Mono("-howtorun:object") & " specified, the fully " &
|
||||
"qualified name of a top-level " &
|
||||
"Scala object may be specified. The object should previously have " &
|
||||
"been compiled using " & Link(Bold("scalac") & "(1)", "scalac.html") &
|
||||
".",
|
||||
|
||||
|
||||
"With " & Mono("-howtorun:script") & " specified, a file " &
|
||||
"containing Scala code may be specified."
|
||||
),
|
||||
|
||||
|
||||
"If " & Mono("-howtorun:") & " is left as the default (" & Mono("guess") &
|
||||
"), then the " & MBold(command) & " command " &
|
||||
"will check whether a file of the " &
|
||||
"specified name exists. If it does, then it will treat it as a " &
|
||||
"script file; if it does not, then it will treat it as the name " &
|
||||
"of an object.",
|
||||
|
||||
|
||||
"In all three cases, arbitrary scalac options may be specified. "&
|
||||
"The most common option is to specify a classpath with " &
|
||||
Mono("-classpath") & ", but see the " &
|
||||
Link(Bold("scalac") & "(1)", "scalac.html") & " page for " &
|
||||
"full details. ",
|
||||
|
||||
|
||||
|
||||
"If an object is specified to run, then that object must be a top-level " &
|
||||
"Scala object with the specified name. The object must define a method " &
|
||||
Bold("main") & " with the following signature:",
|
||||
|
@ -97,23 +96,22 @@ object scala extends Command {
|
|||
"Scala statements and declarations in the file are processed in order. " &
|
||||
"Any arguments specified will be available via the " & Mono("args") &
|
||||
"variable.",
|
||||
|
||||
|
||||
"Script files may have an optional header fthat is ignored if " &
|
||||
"present. There are two ways to format the header: either beginning with " &
|
||||
Mono("#!") & " and ending with " & Mono("!#") & ", or beginning with " &
|
||||
Mono("::#!") & " and ending with " & Mono("::!#") & ".",
|
||||
|
||||
|
||||
"Such a header must have each header boundary start at the beginning of a " &
|
||||
"line. Headers can be used to make stand-alone script files, as shown " &
|
||||
"in the examples below.",
|
||||
|
||||
|
||||
"If " & Mono("scala") & " is run from an sbaz(1) directory, " &
|
||||
"then it will add to its classpath any jars installed in the " &
|
||||
"lib directory of the sbaz directory. Additionally, if no " &
|
||||
"-classpath option is specified, then " & Mono("scala") &
|
||||
" will add " & Quote(".") & ", the current directory, to the " &
|
||||
"end of the classpath.")
|
||||
|
||||
|
||||
val options = Section("OPTIONS",
|
||||
|
||||
|
@ -140,28 +138,28 @@ object scala extends Command {
|
|||
val examples = Section("EXAMPLES",
|
||||
|
||||
"Here are some examples of running Scala code:",
|
||||
|
||||
|
||||
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("JAVACMD") & Mono("=/usr/local/bin/cacao ") &
|
||||
CmdLine(CmdOption("classpath", "classes") & "hello.HelloWorld")),
|
||||
|
||||
|
||||
Definition(
|
||||
"Execute a Scala program using JVM options",
|
||||
MBold("JAVACMD") & Mono("=\"java -Dmsg=hello -enableassertions\" ") &
|
||||
CmdLine(CmdOption("classpath", "classes") & "hello.HelloWorld"))),
|
||||
|
||||
|
||||
"Here is a complete Scala script for Unix: ",
|
||||
|
||||
CodeSample(
|
||||
|
@ -170,9 +168,9 @@ object scala extends Command {
|
|||
"!#\n" +
|
||||
"Console.println(\"Hello, world!\")\n" +
|
||||
"argv.toList foreach Console.println"),
|
||||
|
||||
|
||||
"Here is a complete Scala script for Unix: ",
|
||||
|
||||
|
||||
CodeSample(
|
||||
"::#!\n" +
|
||||
"@echo off\n" +
|
||||
|
@ -193,6 +191,7 @@ object scala extends Command {
|
|||
|
||||
val seeAlso = Section("SEE ALSO",
|
||||
|
||||
Link(Bold("fsc") & "(1)", "fsc.html") & ", " &
|
||||
Link(Bold("sbaz") & "(1)", "sbaz.html") & ", " &
|
||||
Link(Bold("scalac") & "(1)", "scalac.html") & ", " &
|
||||
Link(Bold("scaladoc") & "(1)", "scaladoc.html") & ", " &
|
||||
|
|
|
@ -287,6 +287,7 @@ object scalac extends Command {
|
|||
|
||||
val seeAlso = Section("SEE ALSO",
|
||||
|
||||
Link(Bold("fsc") & "(1)", "fsc.html") & ", " &
|
||||
Link(Bold("sbaz") & "(1)", "sbaz.html") & ", " &
|
||||
Link(Bold("scala") & "(1)", "scala.html") & ", " &
|
||||
Link(Bold("scaladoc") & "(1)", "scaladoc.html") & ", " &
|
||||
|
|
|
@ -82,6 +82,7 @@ object scaladoc extends Command {
|
|||
|
||||
val seeAlso = Section("SEE ALSO",
|
||||
|
||||
Link(Bold("fsc") & "(1)", "fsc.html") & ", " &
|
||||
Link(Bold("sbaz") & "(1)", "sbaz.html") & ", " &
|
||||
Link(Bold("scala") & "(1)", "scala.html") & ", " &
|
||||
Link(Bold("scalac") & "(1)", "scalac.html") & ", " &
|
||||
|
|
|
@ -82,6 +82,7 @@ object scalap extends Command {
|
|||
|
||||
val seeAlso = Section("SEE ALSO",
|
||||
|
||||
Link(Bold("fsc") & "(1)", "fsc.html") & ", " &
|
||||
Link(Bold("sbaz") & "(1)", "sbaz.html") & ", " &
|
||||
Link(Bold("scala") & "(1)", "scala.html") & ", " &
|
||||
Link(Bold("scalac") & "(1)", "scalac.html") & ", " &
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
<ul class="ContentList">
|
||||
<li>
|
||||
<a href="#basic"><b class="SansSerif">Basic Tools</b></a> (<code>sbaz</code>,
|
||||
<code>scala</code>, <code>scalac</code>, <code>scaladoc</code>,
|
||||
<code>scalaint</code>, <code>scalap</code>, <code>scalascript</code>)
|
||||
<code>fsc</code>, <code>scala</code>, <code>scalac</code>, <code>scaladoc</code>,
|
||||
<code>scalap</code>)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -120,6 +120,17 @@
|
|||
<th>Brief Description</th>
|
||||
<th>Links to Reference Pages</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%" valign="top">
|
||||
<span class="tool">fsc</span>
|
||||
</td>
|
||||
<td width="70%" valign="top">
|
||||
The fast Scala compiler.
|
||||
</td>
|
||||
<td width="17%" valign="top">
|
||||
[<a href="fsc.html">Solaris, Linux and Windows</a>]
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="13%" valign="top">
|
||||
<span class="tool">sbaz</span>
|
||||
|
|
Loading…
Reference in New Issue