PHP code example of malenki / argile

1. Go to this page and download the library: Download malenki/argile library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

malenki / argile example snippets


use Malenki\Argile\Options as Options;

$opt = Options::getInstance();

$opt->newSwitch('switch')
    ->short('s')
    ->help('I am a very simple switch arg with only short form.')
    ;
$opt->newValue('foo')
    ->'))
{
    printf("\"foo\" arg selected! Its value is: \"%s\"\n", $opt->get('foo'));
}

exit();

use Malenki\Argile\Options as Options;

$opt = Options::getInstance();

$opt->newValue('foo')
    ->ms.', 'FILE')
    ;

//...


use Malenki\Argile\Options as Options;

$opt = Options::getInstance();

$opt->addGroup('one', 'Optional title for first group');
$opt->addGroup('two', 'Optional title for second group');

$opt->newSwitch('switch', 'one')
    ->short('s')
    ->help('I am a very simple switch arg with only short form.')
    ;
$opt->newValue('foo', 'one')
    ->

use Malenki\Argile\Options as Options;

$opt = Options::getInstance();
$opt->flexible(); // yes, that's all

// and add your options and other thing…

use Malenki\Argile\Options as Options;

$opt = Options::getInstance();
$opt->labelColor('red'); // color for labels
$opt->optColor('red'); // color for options
$opt->bold(); // labels and options becomes bold

// and add your options and other thing…
 php
use Malenki\Argile\Options as Options;

$opt = Options::getInstance();

$opt->newSwitch('switch')
    ->short('s')
    ->help('I am a very simple switch arg with only short form.')
    ;

$opt->parse();

if($opt->has('switch'))
{
    printf("\"switch\" arg selected!\n");
}
exit();