99designs/cliph

A library for testable command-line applications

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

This package is not auto-updated.

Last update: 2024-11-09 15:31:01 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.