On Friday, 1 September 2017 at 17:23:01 UTC, Jon Degenhardt wrote:Hi,
On Friday, 1 September 2017 at 13:13:39 UTC, Vino.B wrote:
Hi All,
When i run the below program without any arguments "D1.d -r" it is throwing error, but i need it to show the help menu
[snip...]
Hi Vino,
To get good error message behavior you need to put the construct in a try-catch block. Then you can choose how to respond. An example here: https://github.com/eBay/tsv-utils-dlang/blob/master/tsv-appe . This code prints outs the error message from the exception. In your case: "Missing value for argument -r.". But, you could also print out the help text as well. There is an example of that as well in the above code block, look for the 'if (r.helpWanted)' test.nd/src/tsv-append.d#L138-L194
--Jon
Thank you very much, that helped me to resolve the issue.