Skip to content

Commit

Permalink
Merge pull request #81 from xsist10/version_in_cli
Browse files Browse the repository at this point in the history
Added version number to CLI output.
  • Loading branch information
xsist10 authored Nov 3, 2022
2 parents 5013c55 + b38e2ed commit 1a5c268
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bin/cadfael
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use Cadfael\Cli\Command\RunCommand;
use Cadfael\Cli\Command\AboutCommand;

$application = new Application();
$application->setName('Cadfael CLI');
$application->setVersion('0.2.5');
$application->add(new AboutCommand());
$application->add(new RunCommand());
$application->run();
4 changes: 3 additions & 1 deletion src/Cli/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($input->getOption('output-format') === 'json') {
$this->formatter = new Json($output);
}
$this->formatter->write('Cadfael CLI Tool')->eol();

$title = $this->getApplication()->getLongVersion();
$this->formatter->write($title)->eol();
$this->formatter->eol();

$this->displayDatabaseDetails($input);
Expand Down

0 comments on commit 1a5c268

Please sign in to comment.