From a1b8fcbf3027241b1759458127e55d5e8949d2c1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 23 Mar 2018 16:58:21 +0800 Subject: [PATCH] Update README.md Add helpfull description for help message showing --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 2edca5b..911d1a2 100644 --- a/README.md +++ b/README.md @@ -440,6 +440,15 @@ The creation of the `--help` option can be disabled by passing `null` as the constructing a `HelpFormatter` instance. In the above example a `DefaultHelpFormatter` was created with the prologue and epilogue. +For correct show help message you must add handler for help exception: +``` +val parser = try { + ArgParser(args).parseInfo(::YourParser) +} catch (e: ShowHelpException) { + e.printAndExit() +} +``` + ## Caveats