added details for -g option and default values in man pages

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@8273 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
michelou 2006-07-27 14:46:11 +00:00
parent 158fdc9b8e
commit 6e6d6fa12c
4 changed files with 62 additions and 15 deletions

View File

@ -56,6 +56,19 @@ object scalac extends Command {
Definition(
CmdOption("g"),
"Generate debugging info"),
Definition(
CmdOption("g:none"),
"Generate no debugging info"),
Definition(
CmdOption("g:{source,lines,vars,notc}"),
SeqPara(
"Generate only some debugging info.",
Mono("\"source\"") & " generates only the source file attribute,",
Mono("\"lines\"") & " generates source and line number information,",
Mono("\"vars\"") & " generates source, line number and local " &
"variable information,",
Mono("\"notc\"") & " generates all of the above and " &
Italic("will not") & " perform tail call optimization.")),
Definition(
CmdOption("nowarn"),
"Generate no warnings"),
@ -64,10 +77,16 @@ object scalac extends Command {
"Output messages about what the compiler is doing"),
Definition(
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). This does not override the " &
"built-in (" & Mono("\"boot\"") & ") search path."),
SeqPara(
"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). This does not override the " &
"built-in (" & Mono("\"boot\"") & ") search path.",
"The default class path is the current directory. Setting the " &
Mono("CLASSPATH") & " variable or using the " & Mono("-classpath") & " " &
"command-line option overrides that default, so if you want to " &
"include the current directory in the search path, you must " &
"include " & Mono("\".\"") & " in the new settings.")),
Definition(
CmdOption("sourcepath", Argument("path")),
"Specify where to find input source files."),
@ -83,12 +102,20 @@ object scalac extends Command {
"Specify where to place generated class files."),
Definition(
CmdOption("encoding", Argument("encoding")),
"Specify character encoding used by source files."),
SeqPara(
"Specify character encoding used by source files.",
"The default value is platform-specific (Linux: " & Mono("\"UTF8\"") &
", Windows: " & Mono("\"Cp1252\"") & "). Executing the following " &
"code in the Scala interpreter will return the default value " &
"on your system:",
MBold(" scala>") &
Mono("new java.io.InputStreamReader(System.in).getEncoding"))),
Definition(
CmdOption("target:", Argument("target")),
"Specify which backend to use (" & Mono(Italic("jvm-1.5") & ", " &
Italic("jvm-1.4") & ", " & Italic("msil") & ", " & Italic("cldc")) &
")."),
SeqPara(
"Specify which backend to use (" & Mono("jvm-1.5,jvm-1.4," &
"msil,cldc") & ").",
"The default value is " & Mono("\"jvm-1.4\"") & ".")),
Definition(
CmdOption("migrate"),
"Assist in migrating from Scala version 1.0."),
@ -128,7 +155,9 @@ object scalac extends Command {
"Enable gadt for classes."),
Definition(
CmdOption("Xlinearizer", Argument("Xlinearizer")),
"Linearizer to use (" & Mono("normal,dfs,rpo") & ")."),
SeqPara(
"Linearizer to use (" & Mono("dfs,dump,normal,rpo") & ").",
"The default value is " & Mono("\"rpo\"") & ".")),
Definition(
CmdOption("Xgenerics"),
"Use generic Java types."))),
@ -167,7 +196,9 @@ object scalac extends Command {
"Print out program after " & Argument("phases") & " (see below)."),
Definition(
CmdOption("printer:", Argument("printer")),
"Printer to use."),
SeqPara(
"Printer to use (" & Mono("text,html") & ").",
"The default value is " & Mono("\"text\"") & ".")),
Definition(
CmdOption("print-file", Argument("file")),
"Specify file in which to print trees."),

View File

@ -20,11 +20,19 @@ object EmitHtml {
/* */
def emitSection(section: Section, depth: int): Unit = {
def emitPara(text: AbstractText): Unit = {
out.println("<div>")
emitText(text)
out.println("\n</div>")
}
def emitText(text: AbstractText): Unit =
text match {
case seq:SeqText =>
seq.components.foreach(emitText)
case seq:SeqPara =>
seq.components.foreach(emitPara)
case Text(text) =>
out.print(escape(text))
@ -77,7 +85,7 @@ object EmitHtml {
out.print("</a>")
case _ =>
error("unknown text node " + text)
error("unknown text node: " + text)
}
def emitParagraph(para: Paragraph): Unit =
@ -122,7 +130,7 @@ object EmitHtml {
emitSection(sect, depth + 1)
case _ =>
error("unknown paragraph node " + para)
error("unknown paragraph node: " + para)
}
val name = section.title.replaceAll("\\p{Space}", "_").toLowerCase()

View File

@ -20,11 +20,18 @@ object EmitManPage {
text.replaceAll("-", "\\-")
def emitSection(section: Section, depth: int): Unit = {
def emitPara(text: AbstractText): Unit = {
emitText(text)
out.println("\n.IP")
}
def emitText(text: AbstractText): Unit =
text match {
case seq:SeqText =>
seq.components.foreach(emitText)
case seq:SeqPara =>
seq.components.foreach(emitPara)
case Text(text) =>
out.print(escape(text))
@ -70,7 +77,7 @@ object EmitManPage {
emitText(label)
case _ =>
error("unknown text node " + text)
error("unknown text node: " + text)
}
def emitParagraph(para: Paragraph): Unit =
@ -115,10 +122,10 @@ object EmitManPage {
emitText(text)
case EmbeddedSection(sect) =>
emitSection(sect, depth+1)
emitSection(sect, depth + 1)
case _ =>
error("unknown paragraph node " + para)
error("unknown paragraph node: " + para)
}
out.println(".\\\"")

View File

@ -13,6 +13,7 @@ object ManPage {
}
case class SeqText(components: AbstractText*) extends AbstractText
case class SeqPara(components: AbstractText*) extends AbstractText
case class Text(text: String) extends AbstractText
case object MDash extends AbstractText
case object NDash extends AbstractText