test.php 617 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. error_reporting(-1);
  3. require_once __DIR__ . '/vendor/autoload.php';
  4. $args = new cli\Arguments(array(
  5. 'flags' => array(
  6. 'verbose' => array(
  7. 'description' => 'Turn on verbose mode',
  8. 'aliases' => array('v')
  9. ),
  10. 'c' => array(
  11. 'description' => 'A counter to test stackable',
  12. 'stackable' => true
  13. )
  14. ),
  15. 'options' => array(
  16. 'user' => array(
  17. 'description' => 'Username for authentication',
  18. 'aliases' => array('u')
  19. )
  20. ),
  21. 'strict' => true
  22. ));
  23. try {
  24. $args->parse();
  25. } catch (cli\InvalidArguments $e) {
  26. echo $e->getMessage() . "\n\n";
  27. }
  28. print_r($args->getArguments());