You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, running your CLI app without any arguments will show the help screen. However you can set the default action to run one of your commands either by setting the third parameter of the `add` function to `true` or by using the `defaultCommand` function.
280
+
281
+
```php
282
+
$app->add(new InitCommand, 'i', true);
283
+
284
+
# Alternatively
285
+
$app->command('init', 'Init something', 'i');
286
+
$app->defaultCommand('init');
287
+
288
+
# Retrieve the name of the default command
289
+
$default_command = $app->getDefaultCommand();
290
+
```
291
+
277
292
#### Exception handler
278
293
279
294
Set a custom exception handler as callback. The callback receives exception & exit code. The callback may rethrow exception or may exit the program or just log exception and do nothing else.
0 commit comments