Updated help text and corrected argument handling in IRS demo.

This commit is contained in:
Clinton Alexander 2016-06-02 10:10:42 +01:00
parent fad45eaa91
commit 8e9fc2d4c0

View File

@ -87,8 +87,9 @@ fun main(args: Array<String>) {
val role = options.valueOf(roleArg)!! val role = options.valueOf(roleArg)!!
if(role == IRSDemoRole.Trade) { if(role == IRSDemoRole.Trade) {
val tradeId: String? = options.valuesOf(tradeIdArg)[0] val args : List<String> = options.valuesOf(tradeIdArg)
if (tradeId != null) { if (args.size > 0) {
val tradeId = args[0]
if (runTrade(tradeId)) { if (runTrade(tradeId)) {
exitProcess(0) exitProcess(0)
} else { } else {
@ -99,8 +100,9 @@ fun main(args: Array<String>) {
exitProcess(1) exitProcess(1)
} }
} else if(role == IRSDemoRole.Date) { } else if(role == IRSDemoRole.Date) {
val dateStr: String? = options.valueOf(dateArg) val args = options.valuesOf(dateArg)
if(dateStr != null) { if (args.size > 0) {
val dateStr = args[0]
runDateChange(dateStr) runDateChange(dateStr)
} else { } else {
println("Please provide a date") println("Please provide a date")
@ -373,6 +375,6 @@ private fun createDefaultConfigFile(configFile: Path?, defaultLegalName: String)
private fun printHelp() { private fun printHelp() {
println(""" println("""
Please refer to the documentation that doesn't yet exist to learn how to run the demo. Please refer to the documentation in docs/build/index.html to learn how to run the demo.
""".trimIndent()) """.trimIndent())
} }