diff --git a/daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala b/daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala index 8aec2dcb71..ba35a43064 100644 --- a/daffodil-cli/src/main/scala/org/apache/daffodil/cli/Main.scala +++ b/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 [-r ] | -P ) - | [-c ] [-D=...] [-I ] - | [-o ] [--stream] [-T=...] [-V ] - | [infile] + banner("""|Usage: daffodil parse (-s | -P ) [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 + | |Parse Options:""".stripMargin) descr("Parse data to a DFDL infoset") @@ -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." ) val schema = opt[URISchemaSource]( @@ -402,7 +396,8 @@ 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." ) val validate: ScallopOption[ValidationMode.Type] = opt[ValidationMode.Type]( short = 'V', @@ -410,6 +405,16 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream 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." + )(optionalValueConverter[String](a => a)) + val trace = opt[Boolean]( + descr = "Run this program with verbose trace output. " + + "Cannot be used with the --debug option." + ) val infile = trailArg[String]( required = false, @@ -419,6 +424,8 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream // must have one of --schema or --parser requireOne(schema, parser) + mutuallyExclusive(trace, debug) // cannot provide both --trace and --debug + // if --parser is provided, cannot also provide --root or -T conflicts(parser, List(rootNS, tunables)) @@ -450,13 +457,12 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream // Unparse Subcommand Options object unparse extends scallop.Subcommand("unparse") { - banner("""|Usage: daffodil unparse (-s [-r ] | -P ) - | [-c ] [-D=...] [-I ] - | [-o ] [--stream] [-T=...] [-V ] - | [infile] + banner("""|Usage: daffodil unparse (-s | -P ) [--] [infile] | |Unparse an infoset file, using either a DFDL schema or a saved parser | + |-- can be used to separate command-line options from trailing arguments + | |Unparse Options:""".stripMargin) descr("Unparse a DFDL infoset") @@ -495,8 +501,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." ) val schema = opt[URISchemaSource]( @@ -516,7 +523,8 @@ 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." ) val validate: ScallopOption[ValidationMode.Type] = opt[ValidationMode.Type]( short = 'V', @@ -524,7 +532,16 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream 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." + )(optionalValueConverter[String](a => a)) + val trace = opt[Boolean]( + descr = "Run this program with verbose trace output. " + + "Cannot be used with the --debug option." + ) val infile = trailArg[String]( required = false, descr = "Input file to unparse. If not specified, or a value of -, reads from stdin." @@ -533,6 +550,8 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream // must have one of --schema or --parser requireOne(schema, parser) + mutuallyExclusive(trace, debug) // cannot provide both --trace and --debug + // if --parser is provided, cannot also provide --root or -T conflicts(parser, List(rootNS, tunables)) @@ -558,12 +577,12 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream // Save Parser Subcommand Options object save extends scallop.Subcommand("save-parser") { - banner("""|Usage: daffodil save-parser -s [-r ] - | [-c ] [-D=...] [-T=...] - | [outfile] + banner("""|Usage: daffodil save-parser -s [SAVE_PARSER_OPTIONS] [--] [outfile] | |Create and save a parser using a DFDL schema | + |-- can be used to separate command-line options from trailing arguments + | |Save Parser Options:""".stripMargin) descr("Save a Daffodil parser for reuse") @@ -617,11 +636,13 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream // Test Subcommand Options object test extends scallop.Subcommand("test") { banner( - """|Usage: daffodil test [-I ] [-l] [-r] [-i] [testnames...] - | - |List or execute tests in a TDML file - | - |Test Options:""".stripMargin + """|Usage: daffodil test [TEST_OPTIONS] [--] [testnames...] + | + |List or execute tests in a TDML file + | + |-- can be used to separate command-line options from trailing arguments + | + |Test Options:""".stripMargin ) descr("List or execute TDML tests") @@ -638,25 +659,37 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream tally(descr = "Increment test result information output level, one level for each -i") val list = opt[Boolean](descr = "Show names and descriptions instead of running test cases") val regex = opt[Boolean](descr = "Treat as regular expressions") + 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." + )(optionalValueConverter[String](a => a)) + val trace = opt[Boolean]( + descr = "Run this program with verbose trace output. " + + "Cannot be used with the --debug option." + ) val tdmlfile = trailArg[String](required = true, descr = "Test Data Markup Language (TDML) file") val testnames = trailArg[List[String]]( required = false, descr = "Name(s) of test cases in tdmlfile. If not given, all tests in tdmlfile are run." ) + + mutuallyExclusive(trace, debug) // cannot provide both --trace and --debug } // Performance Subcommand Options object performance extends scallop.Subcommand("performance") { - banner("""|Usage: daffodil performance (-s [-r ] | -P ) - | [-c ] [-D=...] [-I ] - | [-N ] [-t ] [-T=...] - | [-u] [-V ] - | + banner( + """|Usage: daffodil performance (-s | -P ) [PERFORMANCE_OPTIONS] [--] | |Run a performance test, using either a DFDL schema or a saved parser | - |Performance Options:""".stripMargin) + |-- can be used to separate command-line options from trailing arguments + | + |Performance Options:""".stripMargin + ) descr("Run performance test") helpWidth(width) @@ -696,8 +729,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." ) val schema = opt[URISchemaSource]( @@ -717,7 +751,8 @@ 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." ) val unparse = opt[Boolean]( default = Some(false), @@ -772,13 +807,15 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream extends scallop.Subcommand(languageArg) { val language = languageArg - banner(s"""|Usage: daffodil generate $language -s [-r ] - | [-c ] [-T=...] - | [outdir] + banner( + s"""|Usage: daffodil generate $language -s [GENERATE_OPTIONS] [--] [outdir] | |Generate $languageName code from a DFDL schema to parse or unparse data | - |Generate Options:""".stripMargin) + |-- can be used to separate command-line options from trailing arguments + | + |Generate Options:""".stripMargin + ) descr(s"Generate $languageName code from a DFDL schema") helpWidth(width) @@ -825,10 +862,12 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream // Encode or decode EXI Subcommand Options object exi extends scallop.Subcommand("exi") { - banner("""|Usage: daffodil exi [-d] [-s ] [-o ] [infile] + banner("""|Usage: daffodil exi [EXI_OPTIONS] [--] [infile] | |Encode/decode an XML file with EXI. If a schema is specified, it will use schema aware encoding/decoding. | + |-- can be used to separate command-line options from trailing arguments + | |EncodeEXI Options:""".stripMargin) descr("Encode an XML file with EXI") @@ -860,7 +899,6 @@ class CLIConf(arguments: Array[String], stdout: PrintStream, stderr: PrintStream addSubcommand(generate) addSubcommand(exi) - mutuallyExclusive(trace, debug) // cannot provide both --trace and --debug requireSubcommand() verify() @@ -1012,23 +1050,15 @@ class Main( } } - def withDebugOrTrace(proc: DFDL.DataProcessor, conf: CLIConf): DFDL.DataProcessor = { - (conf.trace() || conf.debug.isDefined) match { + def withDebugOrTrace( + proc: DFDL.DataProcessor, + traceArg: ScallopOption[Boolean], + debugArg: ScallopOption[Option[String]] + ): DFDL.DataProcessor = { + (traceArg() || debugArg.isDefined) match { case true => { val runner = - if (conf.trace()) { - new TraceDebuggerRunner(STDOUT) - } else { - if (System.console == null) { - Logger.log.warn( - s"Using --debug on a non-interactive console may result in display issues" - ) - } - conf.debug() match { - case Some(f) => new CLIDebuggerRunner(new File(f), STDIN, STDOUT) - case None => new CLIDebuggerRunner(STDIN, STDOUT) - } - } + getTraceOrCLIDebuggerRunner(traceArg, debugArg) val id = new InteractiveDebugger(runner, ExpressionCompilers) proc.withDebugger(id).withDebugging(true) } @@ -1036,6 +1066,25 @@ class Main( } } + private def getTraceOrCLIDebuggerRunner( + trace: ScallopOption[Boolean], + debug: ScallopOption[Option[String]] + ) = { + if (trace()) { + new TraceDebuggerRunner(STDOUT) + } else { + if (System.console == null) { + Logger.log.warn( + s"Using --debug on a non-interactive console may result in display issues" + ) + } + debug() match { + case Some(f) => new CLIDebuggerRunner(new File(f), STDIN, STDOUT) + case None => new CLIDebuggerRunner(STDIN, STDOUT) + } + } + } + def createProcessorFromSchema( schemaSource: URISchemaSource, rootNS: Option[RefQName], @@ -1161,7 +1210,7 @@ class Main( }.map { _.withExternalVariables(combineExternalVariables(parseOpts.vars, optDafConfig)) }.map { _.withValidationMode(validate) } - .map { withDebugOrTrace(_, conf) } + .map { withDebugOrTrace(_, parseOpts.trace, parseOpts.debug) } val rc = processor match { case None => ExitCode.UnableToCreateProcessor @@ -1499,7 +1548,7 @@ class Main( }.map { _.withExternalVariables(combineExternalVariables(unparseOpts.vars, optDafConfig)) }.map { _.withValidationMode(validate) } - .map { withDebugOrTrace(_, conf) } + .map { withDebugOrTrace(_, unparseOpts.trace, unparseOpts.debug) } val output = unparseOpts.output.toOption match { case Some("-") | None => STDOUT @@ -1619,20 +1668,8 @@ class Main( val optTDMLImplementation = testOpts.implementation.toOption val tdmlRunnerInit = Runner(tdmlFile, optTDMLImplementation) - val tdmlRunner = if (conf.trace() || conf.debug.isDefined) { - val db = if (conf.trace()) { - new TraceDebuggerRunner(STDOUT) - } else { - if (System.console == null) { - Logger.log.warn( - s"Using --debug on a non-interactive console may result in display issues" - ) - } - conf.debug() match { - case Some(f) => new CLIDebuggerRunner(new File(f), STDIN, STDOUT) - case None => new CLIDebuggerRunner(STDIN, STDOUT) - } - } + val tdmlRunner = if (testOpts.trace() || testOpts.debug.isDefined) { + val db = getTraceOrCLIDebuggerRunner(testOpts.trace, testOpts.debug) val id = new InteractiveDebugger(db, ExpressionCompilers) tdmlRunnerInit.setDebugger(id) tdmlRunnerInit diff --git a/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLIParsing.scala b/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLIParsing.scala index ae0deafc8e..1df8726f25 100644 --- a/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLIParsing.scala +++ b/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLIParsing.scala @@ -536,7 +536,7 @@ class TestCLIParsing { "daffodil-test/src/test/resources/org/apache/daffodil/section06/namespaces/multi_base_15.dfdl.xsd" ) - runCLI(args"-t parse -s $schema") { cli => + runCLI(args"parse -t -s $schema") { cli => cli.sendLine("test", inputDone = true) cli.expect("parser: ") }(ExitCode.Success) @@ -547,7 +547,7 @@ class TestCLIParsing { "daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd" ) - runCLI(args"-t parse -s $schema") { cli => + runCLI(args"parse -t -s $schema") { cli => cli.sendLine("0,1,2,3,,,,", inputDone = true) cli.expectErr("Left over data. Consumed 56 bit(s) with at least") cli.expectErr("Left over data (Hex) starting at byte 8 is: (") @@ -775,7 +775,7 @@ class TestCLIParsing { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/cli_schema_02.dfdl.xsd" ) - runCLI(args"--trace parse --stream -s $schema") { cli => + runCLI(args"parse --trace --stream -s $schema") { cli => cli.send("123", inputDone = true) cli.expect("1") cli.expect("bitPosition: 8") diff --git a/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLISaveParser.scala b/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLISaveParser.scala index 973aa09aa1..a802adb91b 100644 --- a/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLISaveParser.scala +++ b/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLISaveParser.scala @@ -235,30 +235,28 @@ class TestCLISaveParser { } } - // DAFFODIL-1141 - /*@Test*/ + @Test def test_CLI_Saving_SaveParser_debug(): Unit = { val schema = path( "daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd" ) withTempFile { parser => - runCLI(args"-d save-parser -s $schema -r matrix $parser") { cli => - cli.expectErr("Some error about -d not being valid with save-parser") + runCLI(args"save-parser -d -s $schema -r matrix $parser") { cli => + cli.expectErr("Unknown option 'd'") }(ExitCode.Usage) } } - // DAFFODIL-1141 - /*@Test*/ + @Test def test_CLI_Saving_SaveParser_trace(): Unit = { val schema = path( "daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd" ) withTempFile { parser => - runCLI(args"-t save-parser -s $schema -r matrix $parser") { cli => - cli.expectErr("Some error about -t not being valid with save-parser") + runCLI(args"save-parser -t -s $schema -r matrix $parser") { cli => + cli.expectErr("Unknown option 't'") }(ExitCode.Usage) } } @@ -272,7 +270,7 @@ class TestCLISaveParser { ) withTempFile { parser => - runCLI(args"-t save-parser -s $schema -r matrix $parser") { _ => }(ExitCode.Success) + runCLI(args"save-parser -s $schema -r matrix $parser") { _ => }(ExitCode.Success) runCLI(args"unparse --parser $parser $input") { cli => cli.expect("0,1,2") diff --git a/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLItdml.scala b/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLItdml.scala index 900fe98097..a1df130422 100644 --- a/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLItdml.scala +++ b/daffodil-cli/src/test/scala/org/apache/daffodil/cli/cliTest/TestCLItdml.scala @@ -115,7 +115,7 @@ class TestCLItdml { "daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/Entities.tdml" ) - runCLI(args"-t test $tdml byte_entities_6_08") { cli => + runCLI(args"test -t $tdml byte_entities_6_08") { cli => cli.expect("parser:") cli.expect("bitPosition:") cli.expect("data:") @@ -131,7 +131,7 @@ class TestCLItdml { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/debug.txt" ) - runCLI(args"-d $debugFile test $tdml byte_entities_6_08") { cli => + runCLI(args"test -d $debugFile $tdml byte_entities_6_08") { cli => cli.expect("(debug)") cli.expect("Usage:") cli.expect("[Pass] byte_entities_6_08") diff --git a/daffodil-test-integration/src/test/scala/org/apache/daffodil/cliTest/TestCLIDebugger.scala b/daffodil-test-integration/src/test/scala/org/apache/daffodil/cliTest/TestCLIDebugger.scala index 1f36e4edc1..b3cd2c7703 100644 --- a/daffodil-test-integration/src/test/scala/org/apache/daffodil/cliTest/TestCLIDebugger.scala +++ b/daffodil-test-integration/src/test/scala/org/apache/daffodil/cliTest/TestCLIDebugger.scala @@ -89,7 +89,7 @@ class TestCLIDebugger { val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") intercept[Exception] { - runCLI(args"-d parse -s $schema -r matrix $input", fork = false) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = false) { cli => cli.expect("(debug)") cli.sendLine("continue") }(ExitCode.Success) @@ -102,7 +102,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("eval (/invalid)") @@ -137,7 +137,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("garbage") cli.expect("error: undefined command: garbage") @@ -151,7 +151,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("debug") cli.sendLine("info data") @@ -172,7 +172,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("continue") @@ -185,7 +185,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display eval (.)") @@ -222,7 +222,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input6.txt") - runCLI(args"-d parse -s $schema -r e $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("set removeHidden false") cli.sendLine("display info infoset") @@ -244,7 +244,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input6.txt") - runCLI(args"-d parse -s $schema -r e $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("set removeHidden false") cli.sendLine("display info infoset") @@ -264,7 +264,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input3.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break cell") @@ -315,7 +315,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input3.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("set breakOnlyOnCreation false") @@ -367,7 +367,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input5.txt") - runCLI(args"-d parse -s $schema -r Item2 $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r Item2 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info pointsOfUncertainty") @@ -394,7 +394,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info infoset") @@ -430,7 +430,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info infoset") @@ -461,7 +461,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info infoset") @@ -484,7 +484,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info occursIndex") @@ -519,7 +519,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input3.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info infoset") @@ -557,7 +557,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info bitPosition") @@ -584,7 +584,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input4.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break cell") @@ -612,7 +612,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break cell") @@ -637,7 +637,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break cell") @@ -661,7 +661,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input9.txt") - runCLI(args"-d parse -r list -s $schema $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -r list -s $schema $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info groupIndex") @@ -689,7 +689,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input9.txt") - runCLI(args"-d parse -r list -s $schema $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -r list -s $schema $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info dne1") @@ -708,7 +708,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info data") @@ -737,7 +737,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display data") @@ -757,7 +757,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input2.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break row") @@ -792,7 +792,7 @@ class TestCLIDebugger { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/hextest.txt" ) - runCLI(args"-d parse -s $schema -r e2 $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e2 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("info data") @@ -808,7 +808,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("info infoset") @@ -830,7 +830,7 @@ class TestCLIDebugger { withTempFile { input => Files.write(input, "2~3".getBytes(UTF_8)) - runCLI(args"-d parse -s $schema -r e5 $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e5 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break f") @@ -863,7 +863,7 @@ class TestCLIDebugger { withTempFile { input => Files.write(input, "2~3".getBytes(UTF_8)) - runCLI(args"-d parse -s $schema -r e4 $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e4 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break f") @@ -896,7 +896,7 @@ class TestCLIDebugger { withTempFile { input => Files.write(input, "2,3".getBytes(UTF_8)) - runCLI(args"-d parse -s $schema -r e8 $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e8 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break a") @@ -936,7 +936,7 @@ class TestCLIDebugger { withTempFile { input => Files.write(input, "[6~]9".getBytes(UTF_8)) - runCLI(args"-d parse -s $schema -r e9 $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e9 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break e") @@ -1004,7 +1004,7 @@ class TestCLIDebugger { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input12.txt" ) - runCLI(args"-d unparse -s $schema -r e1 $input", fork = true, envs = envs) { cli => + runCLI(args"unparse -d -s $schema -r e1 $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("break e1") cli.expect("1: e1") @@ -1022,7 +1022,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/prefix.txt") - runCLI(args"-d parse -s $schema $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info infoset") cli.expect("(debug)") @@ -1046,7 +1046,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("info variables byteOrder") cli.expect("byteOrder: bigEndian (default)") @@ -1060,7 +1060,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info data text") cli.expect("(debug)") @@ -1076,7 +1076,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info data binary") cli.expect("(debug)") @@ -1092,7 +1092,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r c $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r c $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info diff") cli.expect("(debug)") @@ -1120,7 +1120,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt") - runCLI(args"-d parse -s $schema -r matrix $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r matrix $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info diff") cli.expect("(debug)") @@ -1154,7 +1154,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input6.txt") - runCLI(args"-d parse -s $schema -r e $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema -r e $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info diff") cli.expect("(debug)") @@ -1184,7 +1184,7 @@ class TestCLIDebugger { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt.xml" ) - runCLI(args"-d unparse -s $schema -r matrix -o $devNull $input", fork = true, envs = envs) { + runCLI(args"unparse -d -s $schema -r matrix -o $devNull $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("display info diff") @@ -1224,7 +1224,7 @@ class TestCLIDebugger { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input9.txt.xml" ) - runCLI(args"-d unparse -r list -s $schema -o $devNull $input", fork = true, envs = envs) { + runCLI(args"unparse -d -r list -s $schema -o $devNull $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("set diffExcludes doesNotExist1 bitLimit doesNotExist2") @@ -1259,7 +1259,7 @@ class TestCLIDebugger { ) val input = path("daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input3.txt") - runCLI(args"-d parse -s $schema $input", fork = true, envs = envs) { cli => + runCLI(args"parse -d -s $schema $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("info parser") @@ -1283,7 +1283,7 @@ class TestCLIDebugger { "daffodil-cli/src/test/resources/org/apache/daffodil/cli/input/input1.txt.xml" ) - runCLI(args"-d unparse -s $schema $input", fork = true, envs = envs) { cli => + runCLI(args"unparse -d -s $schema $input", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("info unparser") @@ -1302,7 +1302,7 @@ class TestCLIDebugger { "daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/Entities.tdml" ) - runCLI(args"-d test $tdml byte_entities_6_08", fork = true, envs = envs) { cli => + runCLI(args"test -d -- $tdml byte_entities_6_08", fork = true, envs = envs) { cli => cli.expect("(debug)") cli.sendLine("continue") cli.expect("[Pass] byte_entities_6_08")