function drush_policy_make_me_a_sandwich_validate

8.0.x policy.drush.inc drush_policy_make_me_a_sandwich_validate()
6.x policy.drush.inc drush_policy_make_me_a_sandwich_validate()
7.x policy.drush.inc drush_policy_make_me_a_sandwich_validate()
4.x policy.drush.inc drush_policy_make_me_a_sandwich_validate()
5.x policy.drush.inc drush_policy_make_me_a_sandwich_validate()

Implementation of drush_hook_COMMAND_validate().

Only sudo tells me to make a sandwich: http://xkcd.com/149/

File

examples/policy.drush.inc, line 51
Example policy commandfile. Modify as desired.

Code

function drush_policy_make_me_a_sandwich_validate() {
  $name = posix_getpwuid(posix_geteuid());
  if ($name['name'] !== 'root') {
    return drush_set_error('MAKE_IT_YOUSELF', dt('What? Make your own sandwich.'));
  }
}