From b8178c85e9a9057f25414102307af64a91ac978b Mon Sep 17 00:00:00 2001 From: Rommel Castro Date: Mon, 6 May 2024 10:40:02 -0600 Subject: [PATCH] update `woo:validate-zip` description and output messages --- src/src/Commands/WooValidateZipCommand.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/src/Commands/WooValidateZipCommand.php b/src/src/Commands/WooValidateZipCommand.php index 98385d83..49ea31e0 100644 --- a/src/src/Commands/WooValidateZipCommand.php +++ b/src/src/Commands/WooValidateZipCommand.php @@ -13,20 +13,20 @@ class WooValidateZipCommand extends Command { protected function configure() { $this - ->setDescription( 'Run the validate-zip command.' ) - ->setHelp( 'Run the validate-zip command.' ) - ->addArgument( 'zip', InputArgument::REQUIRED, 'The path to the zip file.' ); + ->setDescription( 'Validate a local ZIP file\'s content.' ) + ->setHelp( 'If invalid content or wrong format is found in ZIP file, an error will be shown.' ) + ->addArgument( 'path', InputArgument::REQUIRED, 'The ZIP file path' ); } protected function execute( InputInterface $input, OutputInterface $output ): int { try { - $zip_file = $input->getArgument( 'zip' ); + $zip_file = $input->getArgument( 'path' ); ZIP::validate_zip( $zip_file ); - $output->writeln( 'Zip file is valid.' ); + $output->writeln( 'Zip file content is valid.' ); } catch ( \Exception $e ) { - $output->writeln( 'Error: ' . $e->getMessage() ); + $output->writeln( sprintf( 'An error occurred while validating the ZIP file. Error: %s', $e->getMessage() ) ); return Command::FAILURE; }