11
0
Fork 0
mirror of https://github.com/n3w/helpers-cli-input.git synced 2025-12-19 12:43:23 +00:00

Compare commits

..

3 commits

4 changed files with 2 additions and 37 deletions

View file

@ -1,6 +1,5 @@
{
"name": "pointybeard/helpers-cli-input",
"version": "1.2.1",
"description": "Collection of classes for handling argv (and other) input when calling command-line scripts. Helps with parsing, collecting and validating arguments, options, and flags.",
"homepage": "https://github.com/pointybeard/helpers-cli-input",
"license": "MIT",
@ -17,11 +16,6 @@
"pointybeard/helpers-foundation-factory": "~1.0",
"pointybeard/helpers-functions-flags": "~1.0"
},
"require-dev": {
"pointybeard/helpers-functions-strings": "~1.1.0",
"pointybeard/helpers-cli-colour": "~1.0",
"pointybeard/helpers-functions-cli": "~1.1.0"
},
"support": {
"issues": "https://github.com/pointybeard/helpers-cli-input/issues",
"wiki": "https://github.com/pointybeard/helpers-cli-input/wiki"

View file

@ -4,7 +4,6 @@ declare(strict_types=1);
include __DIR__.'/../vendor/autoload.php';
use pointybeard\Helpers\Cli\Input;
use pointybeard\Helpers\Cli\Colour\Colour;
use pointybeard\Helpers\Functions\Cli;
// Define what we are expecting to get from the command line
@ -64,34 +63,6 @@ try {
exit;
}
// Display the manual in green text
echo Cli\manpage(
basename(__FILE__),
'1.0.2',
'An example script for the PHP Helpers: Command-line Input and Input Type Handlers composer library (pointybeard/helpers-cli-input).',
$collection,
Colour::FG_GREEN,
Colour::FG_WHITE,
[
'Examples' => 'php -f example/example.php -- -vvv -d example/example.json import',
]
).PHP_EOL.PHP_EOL;
// example.php 1.0.2, An example script for the PHP Helpers: Command-line Input
// and Input Type Handlers composer library (pointybeard/helpers-cli-input).
// Usage: example.php [OPTIONS]... ACTION...
//
// Arguments:
// ACTION The name of the action to perform
//
// Options:
// -v verbosity level. -v (errors only), -vv
// (warnings and errors), -vvv (everything).
// -d, --data=VALUE Path to the input JSON data
//
// Examples:
// php -f example/example.php -- -vvv -d example/example.json import
var_dump($argv->find('action'));
// string(6) "import"

View file

@ -72,6 +72,6 @@ class Argument extends Input\AbstractInputType
$second[$ii] = $secondaryLineLeadPadding.$second[$ii];
}
return $first.implode($second, PHP_EOL);
return $first.implode(PHP_EOL, $second);
}
}

View file

@ -84,6 +84,6 @@ class LongOption extends Input\AbstractInputType
$second[$ii] = $secondaryLineLeadPadding.$second[$ii];
}
return $first.implode($second, PHP_EOL);
return $first.implode(PHP_EOL, $second);
}
}