mirror of
https://github.com/opdavies/versa.git
synced 2025-01-22 19:47:33 +00:00
Add descriptions to commands
This commit is contained in:
parent
82900c719c
commit
d6f04371eb
|
@ -8,6 +8,8 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
|
||||||
abstract class AbstractCommand extends Command
|
abstract class AbstractCommand extends Command
|
||||||
{
|
{
|
||||||
|
protected static string $description;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected Filesystem $filesystem,
|
protected Filesystem $filesystem,
|
||||||
?string $name = null,
|
?string $name = null,
|
||||||
|
@ -17,6 +19,8 @@ abstract class AbstractCommand extends Command
|
||||||
|
|
||||||
protected function configure(): void
|
protected function configure(): void
|
||||||
{
|
{
|
||||||
|
$this->setDescription(static::$description);
|
||||||
|
|
||||||
$this->addOption(
|
$this->addOption(
|
||||||
name: 'args',
|
name: 'args',
|
||||||
shortcut: 'a',
|
shortcut: 'a',
|
||||||
|
|
|
@ -14,6 +14,8 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
|
||||||
final class BuildCommand extends AbstractCommand
|
final class BuildCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
|
public static string $description = 'Build the project';
|
||||||
|
|
||||||
public function execute(InputInterface $input, OutputInterface $output): int
|
public function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$projectType = null;
|
$projectType = null;
|
||||||
|
|
|
@ -12,6 +12,8 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
|
||||||
final class InstallCommand extends AbstractCommand
|
final class InstallCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
|
public static string $description = 'Install the project\'s dependencies';
|
||||||
|
|
||||||
public function execute(InputInterface $input, OutputInterface $output): int
|
public function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$args = $input->getOption('args');
|
$args = $input->getOption('args');
|
||||||
|
|
|
@ -12,6 +12,8 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
final class PackageInstallCommand extends AbstractCommand
|
final class PackageInstallCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
|
public static string $description = 'Install a new package';
|
||||||
|
|
||||||
public function configure(): void
|
public function configure(): void
|
||||||
{
|
{
|
||||||
parent::configure();
|
parent::configure();
|
||||||
|
|
|
@ -13,6 +13,8 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
|
||||||
final class RunCommand extends AbstractCommand
|
final class RunCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
|
public static string $description = 'Run the project';
|
||||||
|
|
||||||
public function execute(InputInterface $input, OutputInterface $output): int
|
public function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$projectType = null;
|
$projectType = null;
|
||||||
|
|
|
@ -9,6 +9,8 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
final class TestCommand extends AbstractCommand
|
final class TestCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
|
public static string $description = 'Run the project\'s tests';
|
||||||
|
|
||||||
public function execute(InputInterface $input, OutputInterface $output): int
|
public function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$args = $input->getOption('args');
|
$args = $input->getOption('args');
|
||||||
|
|
Loading…
Reference in a new issue