How to add extra option to the existing drush command? I'm trying to add extra option to the existing command as below:

/**
 * Implements hook_drush_command_alter().
 */
function MYMODULE_drush_command_alter(&amp;$command) {
  if ($command['command'] == 'features-revert-all') {
    $command['options']['cleanup'] = dt("Remove non-existing components from the database after revert.");
  }
}


However it seems it doesn't work as expected and drush fra --cleanup fails.

Then the help command doesn't show this option either.

What's the proper way of adding such option, so drush can understand it and can be available for further parsing via drush_get_option?
This is done with drush_help_alter rather than drush_command_alter. See the example Drush policy file, reproduced in part below:

function policy_drush_help_alter(&amp;$command) {
  if ($command['command'] == 'updatedb') {
    $command['options']['token'] = 'Per site policy, you must specify a token in the --token option for all commands.';
  }
}