Esempio n. 1
0
/**
 * @param \FusePump\Cli\Inputs $inputs
 * @return \FusePump\Cli\Inputs
 */
function getConfiguredOptions($inputs)
{
    $inputs->option('-q, --quite', 'Run in quite mode (answer Yes to all questions)');
    $inputs->option('-l, --list', 'Just output list of patches');
    $inputs->option('-n, --new', 'Install new patches');
    $inputs->option('-c, --changed', 'Install changed patches');
    $inputs->option('-e, --error', 'Install error patches');
    $inputs->option('-a, --all', 'Install all patches (installed, errors, changed, new)');
    $inputs->option('-i, --interactive', 'Interactive mode');
    $inputs->option('-m, --mark-installed', 'Do not actually apply patch just mark as installed');
    $inputs->option('-s, --stop-on-error', 'Stop patches on error');
    $inputs->option('-cf, --config [filename]', 'Config json filename');
    $inputs->param('masks', 'Filename masks of patches to apply whitespace delimited');
    return $inputs;
}
Esempio n. 2
0
<?php

/**
 * Sandwich maker
 */
require dirname(__FILE__) . '/../lib/FusePump/Cli/Inputs.php';
use FusePump\Cli\Inputs;
$cli = new Inputs($argv);
$cli->option('-h, --ham', 'Add ham');
$cli->option('-m, --mayo', 'Add mayonaise');
$cli->option('-c, --cheese [type]', 'Add a cheese');
$cli->option('-b, --bread [type]', 'Type of bread', true);
// required input
$cli->param('when', 'When do you want the sandwhich (now, tomorrow or never)', true);
if (!$cli->parse()) {
    exit(1);
}
echo "You ordered a sandwich " . $cli->get('when') . " with: \n";
if ($cli->get('-h')) {
    echo " - Ham \n";
}
if ($cli->get('-m')) {
    echo " - Mayonaise \n";
}
if ($cli->get('--cheese')) {
    echo ' - ' . $cli->get('--cheese') . " cheese \n";
}
echo 'On ' . $cli->get('-b') . " bread \n";