stevedlawrence commented on code in PR #1315:
URL: https://github.com/apache/daffodil/pull/1315#discussion_r1775724951
##########
daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala:
##########
@@ -380,8 +373,9 @@ class CLIConf(arguments: Array[String], stdout:
PrintStream, stderr: PrintStream
val rootNS = opt[RefQName](
"root",
argName = "node",
- descr =
- "Root element to use. Can be prefixed with {namespace}. Must be a
top-level element. Defaults to first top-level element of DFDL schema."
+ descr = "Root element to use. Can be prefixed with {namespace}. " +
+ "Must be a top-level element. Defaults to first top-level element of
DFDL schema. " +
+ "Only valid with the --schema option. Cannot be used with the --parser
option."
Review Comment:
Just to keep as succinct as possible to keep --help minimal, we could
probably leave off "cannot be used with the --parser option". I think that's
implied by saying it's only valid with the --schema option and the usage
showing you can only have one one of -s or -P. Same below.
##########
daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala:
##########
@@ -323,24 +323,17 @@ class CLIConf(arguments: Array[String], stdout:
PrintStream, stderr: PrintStream
shortSubcommandsHelp()
// Global Options
- 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 <root>] | -P <parser>)
- | [-c <file>] [-D<variable>=<value>...] [-I
<infoset_type>]
- | [-o <output>] [--stream]
[-T<tunable>=<value>...] [-V <mode>]
- | [infile]
+ banner("""|Usage: daffodil parse (-s <schema> | -P <parser>) [PARSE_OPTS]
[--] [infile]
|
|Parse a file, using either a DFDL schema or a saved parser
|
+ |-- can be used to separate command-line options from trailing
arguments
Review Comment:
I'll open a ticket with scallop to see if they can add a way for "--" to
show up in the --help output. It's usage is rare enough that it probably
doesn't belong in the main description, but I agree that a description is
needed. I think this is unfortunately the only place it can exist without a
scallop change. This is fine for now, but hopefully scallop can support it.
##########
daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala:
##########
@@ -402,14 +396,25 @@ class CLIConf(arguments: Array[String], stdout:
PrintStream, stderr: PrintStream
name = 'T',
keyName = "tunable",
valueName = "value",
- descr = "Tunable configuration options to change Daffodil's behavior"
+ descr = "Tunable configuration options to change Daffodil's behavior. " +
+ "Only valid with the --schema option. Cannot be used with the --parser
option."
)
val validate: ScallopOption[ValidationMode.Type] =
opt[ValidationMode.Type](
short = 'V',
default = Some(ValidationMode.Off),
argName = "mode",
descr = "Validation mode. Use 'on', 'limited', 'off', or a validator
plugin name."
)
+ val debug = opt[Option[String]](
+ argName = "file",
+ descr =
+ "Enable the interactive debugger. Optionally, read initial debugger
commands from [file] if provided. " +
+ "Cannot be used with --trace option. They are mutually exclusive
options."
Review Comment:
Remove "they are mutually exclusive options, think "Cannot be used with
---trace option" is sufficient.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]