Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
This is odd way to do this but it works.
Browse files Browse the repository at this point in the history
Basically you are setting the default command, but you are also
forwarding the params to it.
  • Loading branch information
aubreypwd committed Jan 14, 2023
1 parent 968f920 commit 9a7c7bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/autoload.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

require_once __DIR__ . '/silly.php';
require_once __DIR__ . '/command.php';
6 changes: 5 additions & 1 deletion src/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

$app = new Silly\Application();

$app->command( 'greet name [--yell]', function ($name, $yell, OutputInterface $output) {
// bin/silly __single --yell -- aubrey
$app->command( '__single [name] [--yell]', function ( $name, $yell, OutputInterface $output ) {

if ( ! $yell ) {
return false;
Expand All @@ -23,4 +24,7 @@
$output->writeln( $name );
} );

// When you set a default command, you cannot run sub-commands normally.
$app->setDefaultCommand( '__single', true );

$app->run();

0 comments on commit 9a7c7bb

Please sign in to comment.