Files
lean-console/src/Cli/Storage.php
T

42 lines
2.0 KiB
PHP

<?php
namespace Lean\Console\Cli;
use Mcnd\CLI\OptionValueTypeEnum;
use Notes\CLI\Attribute\{Option, Command};
use Psr\Http\Message\{ServerRequestInterface, ResponseInterface};
use Lean\Console\{Lib, };
# https://www.asciiart.eu/text-to-ascii-art
#[Command(description: PHP_EOL . <<<CLI
#[color:gray, bg: black]╔═════════════════════════╗[#]
#[color:gray, bg: black]║ _ ║[#]
#[color:gray, bg: black]║ | | ___ __ _ _ __ ║[#]
#[color:gray, bg: black]║ | | / _ \/ _` | '_ \ ║[#]
#[color:gray, bg: black]║ | |__| __/ (_| | | | | ║[#]
#[color:gray, bg: black]║ |_____\___|\__,_|_| |_| ║[#]
#[color:gray, bg: black]║ ║[#]
#[color:gray, bg: black]║ STORAGE ║[#]
#[color:gray, bg: black]╚═════════════════════════╝[#]
Try #[color:gray, bg: black]'cli lean-console storage --help'[#] for more information.
CLI
, command: 'lean-console storage')]
#[Option(switch: ['-h', '--help'], description: "Display help for the given command. When no command is given display help for the list command")]
#[Option(switch: ['-q', '--quiet'], description: "Do not output any message")]
#[Option(switch: ['-n', '--no-interaction'], description: "Run script without user interaction")]
#[Option(switch: ['-v', '-vv', '-vvv', '--verbose'], description: "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug", value: OptionValueTypeEnum::OptionalValue)]
class Storage
{
use Lib\ConsoleControllerTrait;
#[Command(description: "Generate entities based on an existing connection", command: "entity:generate")]
#[Option(switch: ['-l', '--list'], description: "")]
public function generate_entity(ServerRequestInterface $request, array $arguments): ResponseInterface
{
dump($arguments);
return $this->renderCLI($request, ":)");
}
}