diff --git a/src/StaticPHP/Command/Dev/EnvCommand.php b/src/StaticPHP/Command/Dev/EnvCommand.php index 2f2dbcf0..160504ed 100644 --- a/src/StaticPHP/Command/Dev/EnvCommand.php +++ b/src/StaticPHP/Command/Dev/EnvCommand.php @@ -15,7 +15,7 @@ class EnvCommand extends BaseCommand { public function configure(): void { - $this->addArgument('env', InputArgument::REQUIRED, 'The environment variable to show, if not set, all will be shown'); + $this->addArgument('env', InputArgument::OPTIONAL, 'The environment variable to show, if not set, all will be shown'); } public function initialize(InputInterface $input, OutputInterface $output): void @@ -31,6 +31,12 @@ class EnvCommand extends BaseCommand $this->output->writeln("Environment variable '{$env}' is not set."); return static::FAILURE; } + if (is_array($val)) { + foreach ($val as $k => $v) { + $this->output->writeln("{$k}={$v}"); + } + return static::SUCCESS; + } $this->output->writeln("{$val}"); return static::SUCCESS; }