Added more useful help message that includes basic usage to the TraderDemo.

This commit is contained in:
Clinton Alexander 2016-06-14 17:03:07 +01:00 committed by Clinton Alexander
parent 98b02e9d33
commit 24deb5a79c

View File

@ -84,7 +84,7 @@ fun runTraderDemo(args: Array<String>): Int {
parser.parse(*args)
} catch (e: Exception) {
println(e.message)
println("Please refer to the documentation in docs/build/index.html to learn how to run the demo.")
printHelp(parser)
return 1
}
@ -377,3 +377,13 @@ private class TraderDemoProtocolSeller(val otherSide: Party,
}
}
private fun printHelp(parser: OptionParser) {
println("""
Usage: trader-demo --role [BUYER|SELLER] [options]
Please refer to the documentation in docs/build/index.html for more info.
""".trimIndent())
parser.printHelpOn(System.out)
}