From 3e6be4abf12ac3cece03bab089f81a4f10b15b63 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Wed, 23 Mar 2016 23:09:45 +0100 Subject: [PATCH] Better output when parsing of arguments doesn't work --- bin/acme | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/acme b/bin/acme index 245d33a..298129d 100755 --- a/bin/acme +++ b/bin/acme @@ -65,19 +65,21 @@ if (!in_array(PHP_SAPI, ["cli", "phpdbg"], true)) { } if (count($argv) === 1 || in_array($argv[1], ["h", "-h", "help", "--help"], true)) { - print $help; + $climate->out($help); exit(0); } if (!in_array($argv[1], $commands)) { - $climate->error("Unknown command '{$argv[1]}'. Use --help for a list of available commands."); + $climate->br()->error(" Unknown command '{$argv[1]}'. Use --help for a list of available commands."); $suggestion = \Kelunik\AcmeClient\suggestCommand($argv[1], $commands); if ($suggestion) { - $climate->br()->info(" Did you mean '$suggestion'?")->br(); + $climate->br()->out(" Did you mean '$suggestion'?"); } + $climate->br(); + exit(1); }