Skip to content

Added a showHelp() method that prints a help message

Thomas Flori requested to merge github/fork/alexkappa/master into master

Created by: alexkappa

$getopt = new Getopt(array(
    array('a', 'alpha', Getopt::NO_ARGUMENT, 'description of a'),
    array('b', 'bravo', Getopt::REQUIRED_ARGUMENT, 'description of bravo'),
    array('c', 'charlie', Getopt::OPTIONAL_ARGUMENT, 'description of charlie')
));

$getopt->parse();

$getopt->showHelp();

Which prints a command line message

usage: mysqcript.php [options] [operands]
 -a, --alpha              description of a
 -b, --bravo <bravo>      description of bravo
 -c, --charlie [charlie]  description of charlie

Merge request reports