From f6533dffccc1941f30241eb8ea8d5fa29b86475f Mon Sep 17 00:00:00 2001 From: Mathieu Ledru Date: Sun, 8 Sep 2024 12:29:01 +0200 Subject: [PATCH] :sparkles: Add social builder --- src/Command/SocialBuilderCommand.php | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/Command/SocialBuilderCommand.php diff --git a/src/Command/SocialBuilderCommand.php b/src/Command/SocialBuilderCommand.php new file mode 100644 index 0000000..3cd6c5f --- /dev/null +++ b/src/Command/SocialBuilderCommand.php @@ -0,0 +1,49 @@ +addArgument('arg1', InputArgument::OPTIONAL, 'Argument description') + ->addOption('option1', null, InputOption::VALUE_NONE, 'Option description') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + $arg1 = $input->getArgument('arg1'); + + if ($arg1) { + $io->note(sprintf('You passed an argument: %s', $arg1)); + } + + if ($input->getOption('option1')) { + // ... + } + + $io->success('You have a new command! Now make it your own! Pass --help to see your options.'); + + return Command::SUCCESS; + } +}