mbeckerle commented on a change in pull request #557:
URL: https://github.com/apache/daffodil/pull/557#discussion_r630428560
##########
File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
##########
@@ -319,40 +319,39 @@ class CLIConf(arguments: Array[String]) extends
scallop.ScallopConf(arguments)
shortSubcommandsHelp()
// Global Options
- val debug = opt[Option[String]](argName = "file", descr = "enable debugging.
Optionally, read initial debugger commands from [file] if
provided.")(optionalValueConverter[String](a => a))
- val trace = opt[Boolean](descr = "run the debugger with verbose trace
output")
- val verbose = tally(descr = "increment verbosity level, one level for each
-v")
- val version = opt[Boolean](descr = "Show version of this program")
+ val debug = opt[Option[String]](argName = "file", descr = "Enable the
interactive debugger. Optionally, read initial debugger commands from [file] if
provided.")(optionalValueConverter[String](a => a))
+ val trace = opt[Boolean](descr = "Run this program with verbose trace
output")
+ val verbose = tally(descr = "Increment verbosity level, one level for each
-v")
+ val version = opt[Boolean](descr = "Show Daffodil's version")
// Parse Subcommand Options
object parse extends scallop.Subcommand("parse") {
- banner("""|Usage: daffodil parse (-s <schema> [-r [{namespace}]<root>] [-p
<path>] |
+ banner("""|Usage: daffodil parse (-s <schema> [-r [{<namespace>}]<root>]
[-p <path>] |
| -P <parser>)
- | [--validate [mode]]
- | [-D[{namespace}]<variable>=<value>...]
[-o <output>]
- | [-I <infoset_type>]
- | [--stream]
- | [-c <file>] [infile]
+ | [-D[{<namespace>}]<variable>=<value>...]
[-o <output>]
Review comment:
what does the curly brace mean?
##########
File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
##########
@@ -319,40 +319,39 @@ class CLIConf(arguments: Array[String]) extends
scallop.ScallopConf(arguments)
shortSubcommandsHelp()
// Global Options
- val debug = opt[Option[String]](argName = "file", descr = "enable debugging.
Optionally, read initial debugger commands from [file] if
provided.")(optionalValueConverter[String](a => a))
- val trace = opt[Boolean](descr = "run the debugger with verbose trace
output")
- val verbose = tally(descr = "increment verbosity level, one level for each
-v")
- val version = opt[Boolean](descr = "Show version of this program")
+ val debug = opt[Option[String]](argName = "file", descr = "Enable the
interactive debugger. Optionally, read initial debugger commands from [file] if
provided.")(optionalValueConverter[String](a => a))
+ val trace = opt[Boolean](descr = "Run this program with verbose trace
output")
+ val verbose = tally(descr = "Increment verbosity level, one level for each
-v")
+ val version = opt[Boolean](descr = "Show Daffodil's version")
// Parse Subcommand Options
object parse extends scallop.Subcommand("parse") {
- banner("""|Usage: daffodil parse (-s <schema> [-r [{namespace}]<root>] [-p
<path>] |
+ banner("""|Usage: daffodil parse (-s <schema> [-r [{<namespace>}]<root>]
[-p <path>] |
| -P <parser>)
- | [--validate [mode]]
- | [-D[{namespace}]<variable>=<value>...]
[-o <output>]
- | [-I <infoset_type>]
- | [--stream]
- | [-c <file>] [infile]
+ | [-D[{<namespace>}]<variable>=<value>...]
[-o <output>]
+ | [-V [mode]] [--stream] [-I
<infoset_type>] [-c <file>]
+ | [infile]
|
|Parse a file, using either a DFDL schema or a saved parser
|
|Parse Options:""".stripMargin)
- descr("parse data to a DFDL infoset")
+ descr("Parse data to a DFDL infoset")
helpWidth(76)
- val schema = opt[URI]("schema", argName = "file", descr = "the annotated
DFDL schema to use to create the parser.")(fileResourceURIConverter)
- val rootNS = opt[RefQName]("root", argName = "node", descr = "the root
element of the XML file to use. An optional namespace may be provided. This
needs to be one of the top-level elements of the DFDL schema defined with
--schema. Requires --schema. If not supplied uses the first element of the
first schema")
- val path = opt[String](argName = "path", descr = "path to the node to
create parser.")
- val parser = opt[File](short = 'P', argName = "file", descr = "use a
previously saved parser.")
- val output = opt[String](argName = "file", descr = "write output to a
given file. If not given or is -, output is written to stdout.")
- val validate: ScallopOption[ValidationMode.Type] =
opt[ValidationMode.Type](short = 'V', default = Some(ValidationMode.Off),
argName = "mode", descr = "the validation mode. 'on', 'limited', 'off', or a
validator plugin name.")
- val vars = props[String]('D', keyName = "variable", valueName = "value",
descr = "variables to be used when parsing. An optional namespace may be
provided.")
- val tunables = props[String]('T', keyName = "tunable", valueName =
"value", descr = "daffodil tunable to be used when parsing.")
- val config = opt[File](short = 'c', argName = "file", descr = "path to
file containing configuration items.")
- val infosetType = opt[InfosetType.Type](short = 'I', argName =
"infoset_type", descr = "infoset type to output. Must be one of 'xml',
'scala-xml', 'json', 'jdom', 'w3cdom', 'sax', or 'null'.", default =
Some(InfosetType.XML))
- val stream = toggle(noshort = true, default = Some(false), descrYes =
"when left over data exists, parse again with remaining data, separating
infosets by a NUL character", descrNo = "stop after the first parse, even if
left over data exists")
- val infile = trailArg[String](required = false, descr = "input file to
parse. If not specified, or a value of -, reads from stdin.")
+ val config = opt[File](short = 'c', argName = "file", descr = "Path to XML
file containing configuration items")
+ val vars = props[String]('D', keyName = "variable", valueName = "value",
descr = "Variables to be used when parsing. An optional namespace may be
provided.")
+ val infosetType = opt[InfosetType.Type](short = 'I', argName =
"infoset_type", descr = "Infoset type to output. Use 'xml', 'scala-xml',
'json', 'jdom', 'w3cdom', 'sax', or 'null'.", default = Some(InfosetType.XML))
+ val output = opt[String](argName = "file", descr = "Output file to write
infoset to. If not given or is -, infoset is written to stdout.")
+ val parser = opt[File](short = 'P', argName = "file", descr = "Use a
previously saved parser")
+ val path = opt[String](argName = "path", descr = "Path from root element
to node from which to start parsing")
Review comment:
I second this change.
##########
File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
##########
@@ -370,78 +369,34 @@ class CLIConf(arguments: Array[String]) extends
scallop.ScallopConf(arguments)
}
- // Performance Subcommand Options
- object performance extends scallop.Subcommand("performance") {
- banner("""|Usage: daffodil performance (-s <schema> [-r
[{namespace}]<root>] [-p <path>] |
- | -P <parser>)
- | [--unparse]
- | [--validate [mode]]
- | [-N <number of files to process>]
- | [-t <threadcount>]
- | [-D[{namespace}]<variable>=<value>...]
- | [-I <infoset_type>]
- | [-c <file>] <infile>
- |
- |Run a performance test (parse or unparse), using either a DFDL
schema or a saved parser
- |
- |Performance Options:""".stripMargin)
-
- descr("run performance test")
- helpWidth(76)
-
- val schema = opt[URI]("schema", argName = "file", descr = "the annotated
DFDL schema to use to create the parser.")(fileResourceURIConverter)
- val unparse = opt[Boolean](default = Some(false), descr = "perform unparse
instead of parse for performance.")
- val rootNS = opt[RefQName]("root", argName = "node", descr = "the root
element of the XML file to use. An optional namespace may be provided. This
needs to be one of the top-level elements of the DFDL schema defined with
--schema. Requires --schema. If not supplied uses the first element of the
schema")
- val number = opt[Int](short = 'N', argName = "number", default = Some(1),
descr = "The total number of files to process.")
- val threads = opt[Int](short = 't', argName = "threads", default =
Some(1), descr = "The number of threads to use.")
- val path = opt[String](argName = "path", descr = "path to the node to
create parser.")
- val parser = opt[File](short = 'P', argName = "file", descr = "use a
previously saved parser.")
- val validate: ScallopOption[ValidationMode.Type] =
opt[ValidationMode.Type](short = 'V', default = Some(ValidationMode.Off),
argName = "mode", descr = "the validation mode. 'on', 'limited', 'off', or a
validator plugin name.")
- val vars = props[String]('D', keyName = "variable", valueName = "value",
descr = "variables to be used when processing. An optional namespace may be
provided.")
- val tunables = props[String]('T', keyName = "tunable", valueName =
"value", descr = "daffodil tunable to be used when processing.")
- val config = opt[File](short = 'c', argName = "file", descr = "path to
file containing configuration items.")
- val infosetType = opt[InfosetType.Type](short = 'I', argName =
"infoset_type", descr = "infoset type to parse/unparse. Must be one of 'xml',
'scala-xml', 'json', 'jdom', 'w3cdom', 'sax', or 'null'.", default =
Some(InfosetType.XML))
- val infile = trailArg[String](required = true, descr = "input file or
directory containing files to process.")
-
- requireOne(schema, parser) // must have one of --schema or --parser
- conflicts(parser, List(rootNS)) // if --parser is provided, cannot also
provide --root
- validateFileIsFile(config) // --config must be a file that exists
-
- validateOpt(infosetType, unparse) {
- case (Some(InfosetType.NULL), Some(true)) => Left("null infoset type not
valid with performance --unparse")
- case _ => Right(Unit)
- }
- }
-
// Unparse Subcommand Options
object unparse extends scallop.Subcommand("unparse") {
- banner("""|Usage: daffodil unparse (-s <schema> [-r [{namespace}]<root>]
[-p <path>] |
+ banner("""|Usage: daffodil unparse (-s <schema> [-r [{<namespace>}]<root>]
[-p <path>] |
| -P <parser>)
- | [--validate [mode]]
- | [-D[{namespace}]<variable>=<value>...]
[-c <file>]
- | [-I <infoset_type>]
- | [--stream]
- | [-o <output>] [infile]
+ |
[-D[{<namespace>}]<variable>=<value>...] [-o <output>]
+ | [-V [mode]] [--stream] [-I
<infoset_type>] [-c <file>]
+ | [infile]
|
|Unparse an infoset file, using either a DFDL schema or a saved
parser
|
|Unparse Options:""".stripMargin)
- descr("unparse a DFDL infoset")
+ descr("Unparse a DFDL infoset")
helpWidth(76)
- val schema = opt[URI]("schema", argName = "file", descr = "the annotated
DFDL schema to use to create the parser.")(fileResourceURIConverter)
- val rootNS = opt[RefQName]("root", argName = "node", descr = "the root
element of the XML file to use. An optional namespace may be provided. This
needs to be one of the top-level elements of the DFDL schema defined with
--schema. Requires --schema. If not supplied uses the first element of the
schema")
- val path = opt[String](argName = "path", descr = "path to the node to
create parser.")
- val parser = opt[File](short = 'P', argName = "file", descr = "use a
previously saved parser.")
- val output = opt[String](argName = "file", descr = "write output to file.
If not given or is -, output is written to standard output.")
- val validate: ScallopOption[ValidationMode.Type] =
opt[ValidationMode.Type](short = 'V', default = Some(ValidationMode.Off),
argName = "mode", descr = "the validation mode. 'on', 'limited', 'off', or a
validator plugin name.")
- val vars = props[String]('D', keyName = "variable", valueName = "value",
descr = "variables to be used when unparsing. An optional namespace may be
provided.")
- val tunables = props[String]('T', keyName = "tunable", valueName =
"value", descr = "daffodil tunable to be used when parsing.")
- val config = opt[File](short = 'c', argName = "file", descr = "path to
file containing configuration items.")
- val infosetType = opt[InfosetType.Type](short = 'I', argName =
"infoset_type", descr = "infoset type to unparse. Must be one of 'xml',
'scala-xml', 'json', 'jdom', 'w3cdom' or 'sax'.", default =
Some(InfosetType.XML))
- val stream = toggle(noshort = true, default = Some(false), descrYes =
"split the input data on the NUL character, and unparse each chuck separately",
descrNo = "treat the entire input data as one infoset")
- val infile = trailArg[String](required = false, descr = "input file to
unparse. If not specified, or a value of -, reads from stdin.")
+ val config = opt[File](short = 'c', argName = "file", descr = "Path to XML
file containing configuration items")
+ val vars = props[String]('D', keyName = "variable", valueName = "value",
descr = "Variables to be used when unparsing. An optional namespace may be
provided.")
+ val infosetType = opt[InfosetType.Type](short = 'I', argName =
"infoset_type", descr = "Infoset type to unparse. Use 'xml', 'scala-xml',
'json', 'jdom', 'w3cdom', or 'sax'.", default = Some(InfosetType.XML))
+ val output = opt[String](argName = "file", descr = "Output file to write
unparsed infoset to. If not given or is -, unparsed infoset is written to
stdout.")
Review comment:
Unparsed data makes more sense than Unparsed infoset.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]