setName("sign"); $this->setDescription("Sign and bundle a hotfix"); $this->addOption("signer", "s", InputOption::VALUE_REQUIRED, "Signer e-mail"); $this->addArgument("hotfix", InputArgument::OPTIONAL, "The filename of the hotfix to sign"); } protected function execute(InputInterface $input, OutputInterface $output) { $fix = $input->getArgument("hotfix"); $signer = $input->getOption("signer"); $cmdl = 'gpg --sign --armour --detach'; if ($signer) { $cmdl.= ' --default-key '.$signer; } $cmdl.= ' '.escapeshellarg($fix); passthru($cmdl); $out = $fix.".signed"; file_put_contents($out, file_get_contents($fix). file_get_contents($fix.'.asc') ); unlink($fix.'.asc'); } }