comparison vendor/pear/console_commandline/tests/console_commandline_addcommand_2.phpt @ 0:1e000243b222

vanilla 1.3.3 distro, I hope
author Charlie Root
date Thu, 04 Jan 2018 15:50:29 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e000243b222
1 --TEST--
2 Test for Console_CommandLine::addCommand() method.
3 --ARGS--
4 cmd1 --help 2>&1
5 --FILE--
6 <?php
7
8 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tests.inc.php';
9
10 $parser = new Console_CommandLine();
11 $parser->renderer->line_width = 30;
12 $parser->addCommand('cmd1', array(
13 'description' => '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30'
14 ));
15 $parser->parse();
16
17 ?>
18 --EXPECTF--
19
20 1 2 3 4 5 6 7 8 9 10 11 12 13
21 14 15 16 17 18 19 20 21 22 23
22 24 25 26 27 28 29 30
23
24 Usage:
25 %sconsole_commandline_addcommand_2.php
26 [options] cmd1 [options]
27
28 Options:
29 -h, --help show this help
30 message and exit