From f605849ee0f3300b52ba93a14ff41ddc6a148e4b Mon Sep 17 00:00:00 2001 From: Alannah Kearney Date: Sat, 1 Jun 2019 15:02:30 +1000 Subject: [PATCH] Updated manpage() to work with pointybeard/helpers-cli-input 1.2 --- src/Cli/Cli.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Cli/Cli.php b/src/Cli/Cli.php index 472784b..f9d760b 100644 --- a/src/Cli/Cli.php +++ b/src/Cli/Cli.php @@ -108,13 +108,8 @@ if (!function_exists(__NAMESPACE__.'manpage')) { $arguments[] = (string) $a; } - foreach ($collection->getTypes() as $type) { - if ('Argument' == $type) { - continue; - } - foreach ($collection->getItemsByType($type) as $o) { - $options[] = (string) $o; - } + foreach ($collection->getItemsExcludeByType('Argument') as $o) { + $options[] = (string) $o; } // Add the arguments, if there are any. @@ -208,7 +203,7 @@ if (!function_exists(__NAMESPACE__."\display_error_and_exit")) { $add_background($heading, true), implode($message, PHP_EOL), !empty($trace) && count($trace) > 0 - ? PHP_EOL . sprintf("Trace\r\n==========\r\n%s\r\n", Debug\readable_debug_backtrace($trace)) + ? PHP_EOL.sprintf("Trace\r\n==========\r\n%s\r\n", Debug\readable_debug_backtrace($trace)) : '' );