99designs/cliph

A library for testable command-line applications

Installs: 17 525

Dependents: 1

Stars: 2

Watchers: 6

Language: PHP

v0.1.0 2012-12-20 20:04 UTC

README

<?php

$options = new \Cliph\Options($argv,array(
  '--help,-h','--connect=NULL','--init=',':cmd'
  ));

// show help
if($options->has('-h','--help') || $options->errors())
{
    $options->printErrors();

    echo "\nusage: $argv[0] [..args] [cmd]\n\n";
    echo " --connect <broker>    : connect to broker, instead of localhost\n";
    echo " --init <cmd>          : command to run if cwd doesn't exist and needs initialization\n";
    echo " --help -h             : this documentation\n";
    echo "\n";
    exit(1);
}

echo $options->value('--connect');

Copyright

Copyright (c) 2012 99designs See LICENSE for details.