Skip to content

Instantly share code, notes, and snippets.

@CHH
Created December 7, 2012 09:02
Show Gist options
  • Save CHH/4231972 to your computer and use it in GitHub Desktop.
Save CHH/4231972 to your computer and use it in GitHub Desktop.
Silex for the CLI
<?php
$app = new Application;
$app->match('greet [--yell] <name>', function($name, $options) {
$message = "Hello $name!";
if (isset($options['yell'])) {
$message = strtoupper($message);
}
echo $message, "\n";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment