diff --git a/.gitignore b/.gitignore index 62c8935..e0caea8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea/ \ No newline at end of file +.idea/ +vendor/ \ No newline at end of file diff --git a/Tests/test.php b/Tests/test.php index 30affe0..f0673ec 100644 --- a/Tests/test.php +++ b/Tests/test.php @@ -1,22 +1,6 @@ addOption((new Value('days', 'Nombre jour', new IntegerParser(0, 365)) $cmdline->addOption((new Value('years', 'Nombre d\'années', new IntegerParser(0)))->setDefault(5)); $cmdline->addValue(new \CommandLine\Argument\Value\Value('path', 'Chemin sauvegarde images', new StringParser(), true)); -$args = $cmdline->parseExplicit(array()); +$args = $cmdline->parseExplicit(array('--help')); $cmdline->treatDefaultArguments($args, false); +echo "\n"; var_dump($args); \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..1dfff6d --- /dev/null +++ b/composer.json @@ -0,0 +1,33 @@ +{ + "name": "darkelfe14728/commandline", + "description": "Command line management library (CLI)", + "keywords": [ "cli", "parser" ], + + "minimum-stability": "dev", + "require": { + "php": "^5.6 || ^7.0" + }, + "autoload": { + "psr-4": { + "CommandLine\\": "src/CommandLine/" + }, + "exclude-from-classmap": [ "Tests/" ] + }, + + "readme": "README.md", + "homepage": "https://github.com/darkelfe14728/PhpCommandLine", + "license": "CC-BY-4.0", + "authors": [ + { + "name": "Julien Rosset", + "email": "jul.rosset@gmail.com" + } + ], + "support": { + "email": "jul.rosset@gmail.com", + "issues": "https://github.com/darkelfe14728/PhpCommandLine/issues", + "wiki": "https://github.com/darkelfe14728/PhpCommandLine/wiki", + "docs": "https://github.com/darkelfe14728/PhpCommandLine/wiki", + "source": "https://github.com/darkelfe14728/PhpCommandLine" + } +} \ No newline at end of file