function encrypt_drush_command in Encrypt 8.3
Implements hook_drush_command().
File
- drush/
encrypt.drush.inc, line 27 - Drush integration for Encrypt module.
Code
function encrypt_drush_command() {
$items = [];
$items['encrypt-encrypt'] = [
'description' => "Encrypt text with the provided encryption profile.",
'arguments' => [
'profile' => 'The machine name of the encryption profile to use.',
],
'options' => [
'base64' => 'Output the encrypted text in base64 encoded format.',
],
'examples' => [
"drush encrypt-encrypt profile_name 'text to encrypt'" => 'Encrypts the given text with the specified encryption profile.',
"drush encrypt-encrypt --base64 profile_name 'text to encrypt'" => 'Encrypts the given text with the specified encryption profile and base64-encodes output.',
],
'aliases' => [
'encrypt',
'enc',
],
];
$items['encrypt-decrypt'] = [
'description' => "Decrypt text with the provided encryption profile.",
'arguments' => [
'profile' => 'The machine name of the encryption profile to use.',
],
'options' => [
'base64' => 'Output the encrypted text in base64 encoded format.',
],
'examples' => [
"drush encrypt-decrypt profile_name 'text to decrypt'" => 'Decrypts the given text with the specified encryption profile.',
"drush encrypt-decrypt --base64 profile_name 'text to decrypt'" => 'Decrypts the given base64-encoded text with the specified encryption profile.',
],
'aliases' => [
'decrypt',
'dec',
],
];
$items['encrypt-validate-profile'] = [
'description' => "Validates a provided encryption profile to check if all dependencies are met.",
'arguments' => [
'profile' => 'The machine name of the encryption profile to validate.',
],
'examples' => [
"drush encrypt-validate-profile profile_name" => 'Validates the given encryption profile.',
],
'aliases' => [
'evp',
],
'outputformat' => [
'default' => 'table',
'pipe-format' => 'list',
'field-default' => [
'error',
],
'field-labels' => [
'error' => 'Error messages:',
],
'output-data-type' => 'format-table',
],
];
return $items;
}