当前位置: 首页>>代码示例>>PHP>>正文


PHP ConsoleOptionParser::description方法代码示例

本文整理汇总了PHP中ConsoleOptionParser::description方法的典型用法代码示例。如果您正苦于以下问题:PHP ConsoleOptionParser::description方法的具体用法?PHP ConsoleOptionParser::description怎么用?PHP ConsoleOptionParser::description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConsoleOptionParser的用法示例。


在下文中一共展示了ConsoleOptionParser::description方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDescription

 /**
  * test setting the console description
  *
  * @return void
  */
 public function testDescription()
 {
     $parser = new ConsoleOptionParser('test', FALSE);
     $result = $parser->description('A test');
     $this->assertEquals($parser, $result, 'Setting description is not chainable');
     $this->assertEquals('A test', $parser->description(), 'getting value is wrong.');
     $parser->description(array('A test', 'something'));
     $this->assertEquals("A test\nsomething", $parser->description(), 'getting value is wrong.');
 }
开发者ID:mrbadao,项目名称:api-official,代码行数:14,代码来源:ConsoleOptionParserTest.php

示例2: getOptionParser

 public function getOptionParser()
 {
     $parser = new ConsoleOptionParser($this->name);
     $parser->description(__('RADIUSdesk console for various tasks'));
     $parser->addOption('ping', array('help' => 'Do a ping monitor test', 'boolean' => true));
     $parser->addOption('heartbeat', array('help' => 'Do a heartbeat monitor test', 'boolean' => true));
     $parser->addArgument('action', array('help' => 'The action to do', 'required' => true, 'choices' => array('mon', 'restart_check', 'debug_check', 'auto_close')));
     $parser->epilog('Have alot of fun....');
     return $parser;
 }
开发者ID:smartwifi,项目名称:stores-rd,代码行数:10,代码来源:RdShell.php

示例3: testXmlHelpDescriptionAndEpilog

    /**
     * test description and epilog in the help
     *
     * @return void
     */
    public function testXmlHelpDescriptionAndEpilog()
    {
        $parser = new ConsoleOptionParser('mycommand', false);
        $parser->description('Description text')->epilog('epilog text')->addOption('test', array('help' => 'A test option.'))->addArgument('model', array('help' => 'The model to make.', 'required' => true));
        $formatter = new HelpFormatter($parser);
        $result = $formatter->xml();
        $expected = <<<TEXT
<?xml version="1.0"?>
<shell>
<name>mycommand</name>
<description>Description text</description>
<subcommands />
<options>
\t<option name="--help" short="-h" help="Display this help." boolean="1">
\t\t<default></default>
\t\t<choices></choices>
\t</option>
\t<option name="--test" short="" help="A test option." boolean="0">
\t\t<default></default>
\t\t<choices></choices>
\t</option>
</options>
<arguments>
\t<argument name="model" help="The model to make." required="1">
\t\t<choices></choices>
\t</argument>
</arguments>
<epilog>epilog text</epilog>
</shell>
TEXT;
        $this->assertEquals(new DomDocument($expected), new DomDocument($result), 'Help does not match');
    }
开发者ID:SebFav,项目名称:ApplicationInternet2,代码行数:37,代码来源:HelpFormatterTest.php

示例4: buildFromArray

 /**
  * Build a parser from an array. Uses an array like
  *
  * {{{
  * $spec = array(
  *		'description' => 'text',
  *		'epilog' => 'text',
  *		'arguments' => array(
  *			// list of arguments compatible with addArguments.
  *		),
  *		'options' => array(
  *			// list of options compatible with addOptions
  *		),
  *		'subcommands' => array(
  *			// list of subcommands to add.
  *		)
  * );
  * }}}
  *
  * @param array $spec The spec to build the OptionParser with.
  * @return ConsoleOptionParser
  */
 public static function buildFromArray($spec)
 {
     $parser = new ConsoleOptionParser($spec['command']);
     if (!empty($spec['arguments'])) {
         $parser->addArguments($spec['arguments']);
     }
     if (!empty($spec['options'])) {
         $parser->addOptions($spec['options']);
     }
     if (!empty($spec['subcommands'])) {
         $parser->addSubcommands($spec['subcommands']);
     }
     if (!empty($spec['description'])) {
         $parser->description($spec['description']);
     }
     if (!empty($spec['epilog'])) {
         $parser->epilog($spec['epilog']);
     }
     return $parser;
 }
开发者ID:abhinav67,项目名称:prodigy2,代码行数:42,代码来源:ConsoleOptionParser.php

示例5: getOptionParser

 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = new ConsoleOptionParser($this->name);
     $parser->description(__d('cake_console', 'The CakePHP Testsuite allows you to run test cases from the command line'))->addArgument('category', array('help' => __d('cake_console', 'The category for the test, or test file, to test.'), 'required' => false))->addArgument('file', array('help' => __d('cake_console', 'The path to the file, or test file, to test.'), 'required' => false))->addOption('log-junit', array('help' => __d('cake_console', '<file> Log test execution in JUnit XML format to file.'), 'default' => false))->addOption('log-json', array('help' => __d('cake_console', '<file> Log test execution in JSON format to file.'), 'default' => false))->addOption('log-tap', array('help' => __d('cake_console', '<file> Log test execution in TAP format to file.'), 'default' => false))->addOption('log-dbus', array('help' => __d('cake_console', 'Log test execution to DBUS.'), 'default' => false))->addOption('coverage-html', array('help' => __d('cake_console', '<dir> Generate code coverage report in HTML format.'), 'default' => false))->addOption('coverage-clover', array('help' => __d('cake_console', '<file> Write code coverage data in Clover XML format.'), 'default' => false))->addOption('testdox-html', array('help' => __d('cake_console', '<file> Write agile documentation in HTML format to file.'), 'default' => false))->addOption('testdox-text', array('help' => __d('cake_console', '<file> Write agile documentation in Text format to file.'), 'default' => false))->addOption('filter', array('help' => __d('cake_console', '<pattern> Filter which tests to run.'), 'default' => false))->addOption('group', array('help' => __d('cake_console', '<name> Only runs tests from the specified group(s).'), 'default' => false))->addOption('exclude-group', array('help' => __d('cake_console', '<name> Exclude tests from the specified group(s).'), 'default' => false))->addOption('list-groups', array('help' => __d('cake_console', 'List available test groups.'), 'boolean' => true))->addOption('loader', array('help' => __d('cake_console', 'TestSuiteLoader implementation to use.'), 'default' => false))->addOption('repeat', array('help' => __d('cake_console', '<times> Runs the test(s) repeatedly.'), 'default' => false))->addOption('tap', array('help' => __d('cake_console', 'Report test execution progress in TAP format.'), 'boolean' => true))->addOption('testdox', array('help' => __d('cake_console', 'Report test execution progress in TestDox format.'), 'default' => false, 'boolean' => true))->addOption('no-colors', array('help' => __d('cake_console', 'Do not use colors in output.'), 'boolean' => true))->addOption('stderr', array('help' => __d('cake_console', 'Write to STDERR instead of STDOUT.'), 'boolean' => true))->addOption('stop-on-error', array('help' => __d('cake_console', 'Stop execution upon first error or failure.'), 'boolean' => true))->addOption('stop-on-failure', array('help' => __d('cake_console', 'Stop execution upon first failure.'), 'boolean' => true))->addOption('stop-on-skipped', array('help' => __d('cake_console', 'Stop execution upon first skipped test.'), 'boolean' => true))->addOption('stop-on-incomplete', array('help' => __d('cake_console', 'Stop execution upon first incomplete test.'), 'boolean' => true))->addOption('strict', array('help' => __d('cake_console', 'Mark a test as incomplete if no assertions are made.'), 'boolean' => true))->addOption('wait', array('help' => __d('cake_console', 'Waits for a keystroke after each test.'), 'boolean' => true))->addOption('process-isolation', array('help' => __d('cake_console', 'Run each test in a separate PHP process.'), 'boolean' => true))->addOption('no-globals-backup', array('help' => __d('cake_console', 'Do not backup and restore $GLOBALS for each test.'), 'boolean' => true))->addOption('static-backup', array('help' => __d('cake_console', 'Backup and restore static attributes for each test.'), 'boolean' => true))->addOption('syntax-check', array('help' => __d('cake_console', 'Try to check source files for syntax errors.'), 'boolean' => true))->addOption('bootstrap', array('help' => __d('cake_console', '<file> A "bootstrap" PHP file that is run before the tests.'), 'default' => false))->addOption('configuration', array('help' => __d('cake_console', '<file> Read configuration from XML file.'), 'default' => false))->addOption('no-configuration', array('help' => __d('cake_console', 'Ignore default configuration file (phpunit.xml).'), 'boolean' => true))->addOption('include-path', array('help' => __d('cake_console', '<path(s)> Prepend PHP include_path with given path(s).'), 'default' => false))->addOption('directive', array('help' => __d('cake_console', 'key[=value] Sets a php.ini value.'), 'default' => false))->addOption('fixture', array('help' => __d('cake_console', 'Choose a custom fixture manager.')))->addOption('debug', array('help' => __d('cake_console', 'More verbose output.')));
     return $parser;
 }
开发者ID:medinaccesar,项目名称:blogcake,代码行数:11,代码来源:TestShell.php

示例6: getOptionParser

 /**
  * ConvertShell::getOptionParser()
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $subcommandParser = array('options' => array('plugin' => array('short' => 'p', 'help' => 'The plugin to update. Only the specified plugin will be updated.', 'default' => ''), 'dry-run' => array('short' => 'd', 'help' => 'Dry run the update, no files will actually be modified.', 'boolean' => true), 'ext' => array('short' => 'e', 'help' => 'The extension(s) to search. A pipe delimited list, or a preg_match compatible subpattern', 'default' => 'php')), 'arguments' => ['path' => ['help' => 'Path to folder, defaults to current APP otherwise.']]);
     $name = ($this->plugin ? $this->plugin . '.' : '') . $this->name;
     $parser = new ConsoleOptionParser($name);
     return $parser->description("A shell to help automate upgrading array syntax to PHP5.4")->addSubcommand('run', array('help' => 'Update verbose array syntax to short one.', 'parser' => $subcommandParser));
 }
开发者ID:edukondaluetg,项目名称:cakephp-upgrade,代码行数:12,代码来源:ArraysShell.php

示例7: getOptionParser

 /**
  * ConvertShell::getOptionParser()
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $subcommandParser = array('options' => array('plugin' => array('short' => 'p', 'help' => __d('cake_console', 'The plugin to update. Only the specified plugin will be updated.'), 'default' => ''), 'dry-run' => array('short' => 'd', 'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'), 'boolean' => true), 'ext' => array('short' => 'e', 'help' => __d('cake_console', 'The extension(s) to search. A pipe delimited list, or a preg_match compatible subpattern'), 'default' => 'php')));
     $name = ($this->plugin ? $this->plugin . '.' : '') . $this->name;
     $parser = new ConsoleOptionParser($name);
     return $parser->description(__d('cake_console', "A shell to help automate upgrading array syntax to PHP5.4"))->addSubcommand('arrays', array('help' => __d('cake_console', 'Main method to update verbose array syntax to short one.'), 'parser' => $subcommandParser));
 }
开发者ID:sanjeevkumar12,项目名称:cakephp-upgrade,代码行数:12,代码来源:ConvertShell.php


注:本文中的ConsoleOptionParser::description方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。