Drush: Get input from the user.

  1. 7.x doxygen/html/group__userinput.html
  2. master doxygen/html/group__userinput.html
Drush
Get input from the user.

Functions

 drush_confirm ($msg, $indent=0)
 drush_choice ($options, $prompt= 'Enter a number.', $label= '!value', $widths=array())
 drush_choice_multiple ($options, $defaults=FALSE, $prompt= 'Select some numbers.', $label= '!value', $mark= '!value(selected)', $min=0, $max=NULL, $final_options=array())
 drush_prompt ($prompt, $default=NULL, $required=TRUE, $password=FALSE)

Detailed Description

Function Documentation

drush_choice (   $options,
  $prompt = 'Enter a number.',
  $label = '!value',
  $widths = array() 
)

Ask the user to select an item from a list. From a provided associative array, drush_choice will display all of the questions, numbered from 1 to N, and return the item the user selected. "0" is always cancel; entering a blank line is also interpreted as cancelling.

Parameters
$optionsA list of questions to display to the user. The KEYS of the array are the result codes to return to the caller; the VALUES are the messages to display on each line. Special keys of the form '– something –' can be provided as separator between choices groups. Separator keys don't alter the numbering.
$promptThe message to display to the user prompting for input.
$labelControls the display of each line. Defaults to '!value', which displays the value of each item in the $options array to the user. Use '!key' to display the key instead. In some instances, it may be useful to display both the key and the value; for example, if the key is a user id and the value is the user name, use '!value (uid=!key)'.

Definition at line 429 of file drush.inc.

References drush_get_context(), drush_get_option(), drush_print(), drush_print_pipe(), drush_print_table(), and dt().

Referenced by drush_choice_multiple(), drush_config_edit(), drush_config_export(), drush_config_import(), drush_core_config(), drush_field_create_wizard(), drush_topic_core_topic(), and release_info_fetch().

Here is the call graph for this function:

Here is the caller graph for this function:

drush_choice_multiple (   $options,
  $defaults = FALSE,
  $prompt = 'Select some numbers.',
  $label = '!value',
  $mark = '!value (selected)',
  $min = 0,
  $max = NULL,
  $final_options = array() 
)

Ask the user to select multiple items from a list. This is a wrapper around drush_choice, that repeats the selection process, allowing users to toggle a number of items in a list. The number of values that can be constrained by both min and max: the user will only be allowed finalize selection once the minimum number has been selected, and the oldest selected value will "drop off" the list, if they exceed the maximum number.

Parameters
$optionsSame as drush_choice() (see above).
$defaultsThis can take 3 forms:
  • FALSE: (Default) All options are unselected by default.
  • TRUE: All options are selected by default.
  • Array of $options keys to be selected by default.
$promptSame as drush_choice() (see above).
$labelSame as drush_choice() (see above).
$markControls how selected values are marked. Defaults to '!value (selected)'.
$minConstraint on minimum number of selections. Defaults to zero. When fewer options than this are selected, no final options will be available.
$maxConstraint on minimum number of selections. Defaults to NULL (unlimited). If the a new selection causes this value to be exceeded, the oldest previously selected value is automatically unselected.
$final_optionsAn array of additional options in the same format as $options. When the minimum number of selections is met, this array is merged into the array of options. If the user selects one of these values and the selection process will complete (the key for the final option is included in the return value). If this is an empty array (default), then a built in final option of "Done" will be added to the available options (in this case no additional keys are added to the return value).

Definition at line 534 of file drush.inc.

References drush_choice(), and dt().

Here is the call graph for this function:

drush_confirm (   $msg,
  $indent = 0 
)

Asks the user a basic yes/no question.

Parameters
string$msgThe question to ask.
int$indentThe number of spaces to indent the message.
Returns
bool TRUE if the user enters "y" or FALSE if "n".

Definition at line 375 of file drush.inc.

References drush_get_context(), drush_print(), and drush_print_prompt().

Referenced by _drush_invoke_hooks(), _pm_update_core(), drush_config_export(), drush_config_import(), drush_config_set(), drush_do_multiple_command(), drush_pm_download(), drush_pm_download_validate(), drush_pm_enable(), drush_pm_enable_validate(), drush_preflight_command_dispatch(), drush_sql_create(), drush_sql_drop(), drush_sql_sanitize(), drush_user_cancel(), make_build_path(), and pm_update_packages().

Here is the call graph for this function:

Here is the caller graph for this function:

drush_prompt (   $prompt,
  $default = NULL,
  $required = TRUE,
  $password = FALSE 
)

Prompt the user for input

The input can be anything that fits on a single line (not only y/n), so we can't use drush_confirm()

Parameters
$promptThe text which is displayed to the user.
$defaultThe default value of the input.
$requiredIf TRUE, user may continue even when no value is in the input.
$passwordIf TRUE, surpress printing of the input.
See Also
drush_confirm()

Definition at line 603 of file drush.inc.

References drush_get_context(), drush_print_prompt(), and drush_shell_exec().

Referenced by drush_field_create_wizard(), and drush_user_password().

Here is the call graph for this function:

Here is the caller graph for this function:

File

doxygen/html/group__userinput.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Drush: Get input from the user.</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Get input from the user.</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa4169b83ff9dc4222af95d376b21268b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b">drush_confirm</a> ($msg, $indent=0)</td></tr>
<tr class="memitem:ga7e823bcd58051b17e6e5601340f0c784"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784">drush_choice</a> ($options, $prompt= 'Enter a number.', $label= '!value', $widths=array())</td></tr>
<tr class="memitem:ga915b9fa18b5e95b387bddf5a50a266fe"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__userinput.html#ga915b9fa18b5e95b387bddf5a50a266fe">drush_choice_multiple</a> ($options, $defaults=FALSE, $prompt= 'Select some numbers.', $label= '!value', $mark= '!value(selected)', $min=0, $max=NULL, $final_options=array())</td></tr>
<tr class="memitem:gabbb9a40c8f7e0ba5ec384ccf86305a20"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__userinput.html#gabbb9a40c8f7e0ba5ec384ccf86305a20">drush_prompt</a> ($prompt, $default=NULL, $required=TRUE, $password=FALSE)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<h2>Function Documentation</h2>
<a class="anchor" id="ga7e823bcd58051b17e6e5601340f0c784"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_choice </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$prompt</em> = <code>'Enter&#160;a&#160;number.'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$label</em> = <code>'!value'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$widths</em> = <code>array()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Ask the user to select an item from a list. From a provided associative array, drush_choice will display all of the questions, numbered from 1 to N, and return the item the user selected. "0" is always cancel; entering a blank line is also interpreted as cancelling.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$options</td><td>A list of questions to display to the user. The KEYS of the array are the result codes to return to the caller; the VALUES are the messages to display on each line. Special keys of the form '&ndash; something &ndash;' can be provided as separator between choices groups. Separator keys don't alter the numbering. </td></tr>
    <tr><td class="paramname">$prompt</td><td>The message to display to the user prompting for input. </td></tr>
    <tr><td class="paramname">$label</td><td>Controls the display of each line. Defaults to '!value', which displays the value of each item in the $options array to the user. Use '!key' to display the key instead. In some instances, it may be useful to display both the key and the value; for example, if the key is a user id and the value is the user name, use '!value (uid=!key)'. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="drush_8inc_source.html#l00429">429</a> of file <a class="el" href="drush_8inc_source.html">drush.inc</a>.</p>

<p>References <a class="el" href="context_8inc_source.html#l00328">drush_get_context()</a>, <a class="el" href="context_8inc_source.html#l00405">drush_get_option()</a>, <a class="el" href="output_8inc_source.html#l00026">drush_print()</a>, <a class="el" href="output_8inc_source.html#l00056">drush_print_pipe()</a>, <a class="el" href="output_8inc_source.html#l00216">drush_print_table()</a>, and <a class="el" href="output_8inc_source.html#l00145">dt()</a>.</p>

<p>Referenced by <a class="el" href="drush_8inc_source.html#l00534">drush_choice_multiple()</a>, <a class="el" href="config_8drush_8inc_source.html#l00403">drush_config_edit()</a>, <a class="el" href="config_8drush_8inc_source.html#l00267">drush_config_export()</a>, <a class="el" href="config_8drush_8inc_source.html#l00322">drush_config_import()</a>, <a class="el" href="core_8drush_8inc_source.html#l00662">drush_core_config()</a>, <a class="el" href="field_8drush_8inc_source.html#l00361">drush_field_create_wizard()</a>, <a class="el" href="topic_8drush_8inc_source.html#l00054">drush_topic_core_topic()</a>, and <a class="el" href="updatexml_8inc_source.html#l00041">release_info_fetch()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_ga7e823bcd58051b17e6e5601340f0c784_cgraph.png" border="0" usemap="#group__userinput_ga7e823bcd58051b17e6e5601340f0c784_cgraph" alt=""/></div>
<map name="group__userinput_ga7e823bcd58051b17e6e5601340f0c784_cgraph" id="group__userinput_ga7e823bcd58051b17e6e5601340f0c784_cgraph">
<area shape="rect" id="node3" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="735,162,863,192"/><area shape="rect" id="node5" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8" title="drush_get_option" alt="" coords="520,84,640,113"/><area shape="rect" id="node12" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740" title="drush_print" alt="" coords="348,32,433,61"/><area shape="rect" id="node15" href="group__outputfunctions.html#ga03664ee5326159c3f8e6c97aa93c7981" title="drush_print_pipe" alt="" coords="332,136,449,165"/><area shape="rect" id="node18" href="group__outputfunctions.html#ga2dfb80176f98c67097334acfa98211cd" title="drush_print_table" alt="" coords="153,32,273,61"/><area shape="rect" id="node21" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="195,244,232,273"/><area shape="rect" id="node7" href="context_8inc.html#aee5781894bf828bfa508d9052553f809" title="_drush_get_option" alt="" coords="735,44,863,73"/><area shape="rect" id="node9" href="context_8inc.html#a9f6272c1a68141ce873c07aae3a316ac" title="drush_context_names" alt="" coords="724,97,873,126"/><area shape="rect" id="node23" href="includes_2drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="324,239,457,286"/><area shape="rect" id="node25" href="includes_2drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="508,240,652,269"/><area shape="rect" id="node27" href="includes_2drupal_8inc.html#aa7ac001ed15d678fa533b54d962eb5bc" title="drush_drupal_load_autoloader" alt="" coords="701,240,896,269"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_ga7e823bcd58051b17e6e5601340f0c784_icgraph.png" border="0" usemap="#group__userinput_ga7e823bcd58051b17e6e5601340f0c784_icgraph" alt=""/></div>
<map name="group__userinput_ga7e823bcd58051b17e6e5601340f0c784_icgraph" id="group__userinput_ga7e823bcd58051b17e6e5601340f0c784_icgraph">
<area shape="rect" id="node3" href="group__userinput.html#ga915b9fa18b5e95b387bddf5a50a266fe" title="drush_choice_multiple" alt="" coords="156,5,305,35"/><area shape="rect" id="node5" href="config_8drush_8inc.html#ad72fddd99c71a1a854d36dd81e1a80f1" title="drush_config_edit" alt="" coords="169,59,292,88"/><area shape="rect" id="node7" href="config_8drush_8inc.html#a6258f151a3c27b586409d46f1799a666" title="drush_config_export" alt="" coords="161,112,300,141"/><area shape="rect" id="node9" href="config_8drush_8inc.html#aef4c2b9a90b1297e0e60e741bace5a4e" title="drush_config_import" alt="" coords="161,165,300,195"/><area shape="rect" id="node11" href="core_8drush_8inc.html#a7f88afe2a5459be981ef1cfa4a60af65" title="drush_core_config" alt="" coords="167,219,295,248"/><area shape="rect" id="node13" href="field_8drush_8inc.html#a3e930ec03cf0c5762790d73681f71f8f" title="drush_field_create\l_wizard" alt="" coords="167,271,295,318"/><area shape="rect" id="node15" href="topic_8drush_8inc.html#ae8a604f9b99910a82bc193b3d11490cc" title="drush_topic_core_topic" alt="" coords="153,341,308,371"/><area shape="rect" id="node17" href="updatexml_8inc.html#a7fe4c8cdddd122b232c8daf5484444f9" title="release_info_fetch" alt="" coords="167,395,295,424"/><area shape="rect" id="node19" href="download_8pm_8inc.html#a802dd9a63e5ab3a3a8472d4635d3c662" title="drush_pm_download" alt="" coords="365,368,507,397"/><area shape="rect" id="node21" href="make_8drush_8inc.html#ac8b7447fddc5e9edc48acd98aa680fe5" title="make_prepare_projects" alt="" coords="357,421,515,451"/><area shape="rect" id="node23" href="generate_8contents_8make_8inc.html#ae22e86e5816853f66923925aa90164e1" title="make_generate_from\l_makefile" alt="" coords="563,382,707,429"/><area shape="rect" id="node27" href="make_8drush_8inc.html#a7f6c382e030da87fc401f133edd22f3b" title="make_projects" alt="" coords="581,452,688,481"/><area shape="rect" id="node25" href="make_8drush_8inc.html#a64e3d2b9948951c3f141802f41658359" title="drush_make" alt="" coords="797,395,891,424"/><area shape="rect" id="node30" href="classDrushMakeProject.html#a14e2e297d82eea0e5bd316255d092da8" title="DrushMakeProject\\recurse" alt="" coords="756,452,932,481"/><area shape="rect" id="node32" href="classDrushMakeProject.html#ad59196db4820ff959dd6088fb8293b75" title="DrushMakeProject\\make" alt="" coords="983,452,1148,481"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga915b9fa18b5e95b387bddf5a50a266fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_choice_multiple </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$defaults</em> = <code>FALSE</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$prompt</em> = <code>'Select&#160;some&#160;numbers.'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$label</em> = <code>'!value'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$mark</em> = <code>'!value&#160;(selected)'</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$min</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$max</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$final_options</em> = <code>array()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Ask the user to select multiple items from a list. This is a wrapper around drush_choice, that repeats the selection process, allowing users to toggle a number of items in a list. The number of values that can be constrained by both min and max: the user will only be allowed finalize selection once the minimum number has been selected, and the oldest selected value will "drop off" the list, if they exceed the maximum number.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$options</td><td>Same as <a class="el" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784">drush_choice()</a> (see above). </td></tr>
    <tr><td class="paramname">$defaults</td><td>This can take 3 forms:<ul>
<li>FALSE: (Default) All options are unselected by default.</li>
<li>TRUE: All options are selected by default.</li>
<li>Array of $options keys to be selected by default. </li>
</ul>
</td></tr>
    <tr><td class="paramname">$prompt</td><td>Same as <a class="el" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784">drush_choice()</a> (see above). </td></tr>
    <tr><td class="paramname">$label</td><td>Same as <a class="el" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784">drush_choice()</a> (see above). </td></tr>
    <tr><td class="paramname">$mark</td><td>Controls how selected values are marked. Defaults to '!value (selected)'. </td></tr>
    <tr><td class="paramname">$min</td><td>Constraint on minimum number of selections. Defaults to zero. When fewer options than this are selected, no final options will be available. </td></tr>
    <tr><td class="paramname">$max</td><td>Constraint on minimum number of selections. Defaults to NULL (unlimited). If the a new selection causes this value to be exceeded, the oldest previously selected value is automatically unselected. </td></tr>
    <tr><td class="paramname">$final_options</td><td>An array of additional options in the same format as $options. When the minimum number of selections is met, this array is merged into the array of options. If the user selects one of these values and the selection process will complete (the key for the final option is included in the return value). If this is an empty array (default), then a built in final option of "Done" will be added to the available options (in this case no additional keys are added to the return value). </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="drush_8inc_source.html#l00534">534</a> of file <a class="el" href="drush_8inc_source.html">drush.inc</a>.</p>

<p>References <a class="el" href="drush_8inc_source.html#l00429">drush_choice()</a>, and <a class="el" href="output_8inc_source.html#l00145">dt()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_ga915b9fa18b5e95b387bddf5a50a266fe_cgraph.png" border="0" usemap="#group__userinput_ga915b9fa18b5e95b387bddf5a50a266fe_cgraph" alt=""/></div>
<map name="group__userinput_ga915b9fa18b5e95b387bddf5a50a266fe_cgraph" id="group__userinput_ga915b9fa18b5e95b387bddf5a50a266fe_cgraph">
<area shape="rect" id="node3" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784" title="drush_choice" alt="" coords="205,138,304,167"/><area shape="rect" id="node23" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="395,242,432,271"/><area shape="rect" id="node5" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="935,165,1063,194"/><area shape="rect" id="node7" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8" title="drush_get_option" alt="" coords="720,86,840,115"/><area shape="rect" id="node14" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740" title="drush_print" alt="" coords="548,34,633,63"/><area shape="rect" id="node17" href="group__outputfunctions.html#ga03664ee5326159c3f8e6c97aa93c7981" title="drush_print_pipe" alt="" coords="532,138,649,167"/><area shape="rect" id="node20" href="group__outputfunctions.html#ga2dfb80176f98c67097334acfa98211cd" title="drush_print_table" alt="" coords="353,34,473,63"/><area shape="rect" id="node9" href="context_8inc.html#aee5781894bf828bfa508d9052553f809" title="_drush_get_option" alt="" coords="935,99,1063,129"/><area shape="rect" id="node11" href="context_8inc.html#a9f6272c1a68141ce873c07aae3a316ac" title="drush_context_names" alt="" coords="924,46,1073,75"/><area shape="rect" id="node25" href="includes_2drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="524,241,657,288"/><area shape="rect" id="node27" href="includes_2drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="708,242,852,271"/><area shape="rect" id="node29" href="includes_2drupal_8inc.html#aa7ac001ed15d678fa533b54d962eb5bc" title="drush_drupal_load_autoloader" alt="" coords="901,242,1096,271"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gaa4169b83ff9dc4222af95d376b21268b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_confirm </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$indent</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Asks the user a basic yes/no question.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$msg</td><td>The question to ask. </td></tr>
    <tr><td class="paramtype">int</td><td class="paramname">$indent</td><td>The number of spaces to indent the message.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool TRUE if the user enters "y" or FALSE if "n". </dd></dl>

<p>Definition at line <a class="el" href="drush_8inc_source.html#l00375">375</a> of file <a class="el" href="drush_8inc_source.html">drush.inc</a>.</p>

<p>References <a class="el" href="context_8inc_source.html#l00328">drush_get_context()</a>, <a class="el" href="output_8inc_source.html#l00026">drush_print()</a>, and <a class="el" href="output_8inc_source.html#l00045">drush_print_prompt()</a>.</p>

<p>Referenced by <a class="el" href="includes_2command_8inc_source.html#l00285">_drush_invoke_hooks()</a>, <a class="el" href="updatecode_8pm_8inc_source.html#l00123">_pm_update_core()</a>, <a class="el" href="config_8drush_8inc_source.html#l00267">drush_config_export()</a>, <a class="el" href="config_8drush_8inc_source.html#l00322">drush_config_import()</a>, <a class="el" href="config_8drush_8inc_source.html#l00198">drush_config_set()</a>, <a class="el" href="drush_8inc_source.html#l01252">drush_do_multiple_command()</a>, <a class="el" href="download_8pm_8inc_source.html#l00082">drush_pm_download()</a>, <a class="el" href="download_8pm_8inc_source.html#l00011">drush_pm_download_validate()</a>, <a class="el" href="pm_8drush_8inc_source.html#l01000">drush_pm_enable()</a>, <a class="el" href="pm_8drush_8inc_source.html#l00843">drush_pm_enable_validate()</a>, <a class="el" href="drush_8inc_source.html#l01079">drush_preflight_command_dispatch()</a>, <a class="el" href="sql_8drush_8inc_source.html#l00324">drush_sql_create()</a>, <a class="el" href="sql_8drush_8inc_source.html#l00515">drush_sql_drop()</a>, <a class="el" href="sql_8drush_8inc_source.html#l00537">drush_sql_sanitize()</a>, <a class="el" href="user_8drush_8inc_source.html#l00333">drush_user_cancel()</a>, <a class="el" href="make_8drush_8inc_source.html#l00554">make_build_path()</a>, and <a class="el" href="updatecode_8pm_8inc_source.html#l00241">pm_update_packages()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_gaa4169b83ff9dc4222af95d376b21268b_cgraph.png" border="0" usemap="#group__userinput_gaa4169b83ff9dc4222af95d376b21268b_cgraph" alt=""/></div>
<map name="group__userinput_gaa4169b83ff9dc4222af95d376b21268b_cgraph" id="group__userinput_gaa4169b83ff9dc4222af95d376b21268b_cgraph">
<area shape="rect" id="node3" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="657,5,785,35"/><area shape="rect" id="node5" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740" title="drush_print" alt="" coords="340,59,425,88"/><area shape="rect" id="node14" href="group__outputfunctions.html#ga6dc4aa94bd0a854c564a2538e166c749" title="drush_print_prompt" alt="" coords="157,108,291,137"/><area shape="rect" id="node7" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8" title="drush_get_option" alt="" coords="476,59,596,88"/><area shape="rect" id="node9" href="context_8inc.html#aee5781894bf828bfa508d9052553f809" title="_drush_get_option" alt="" coords="657,59,785,88"/><area shape="rect" id="node11" href="context_8inc.html#a9f6272c1a68141ce873c07aae3a316ac" title="drush_context_names" alt="" coords="647,112,796,141"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_gaa4169b83ff9dc4222af95d376b21268b_icgraph.png" border="0" usemap="#group__userinput_gaa4169b83ff9dc4222af95d376b21268b_icgraph" alt=""/></div>
<map name="group__userinput_gaa4169b83ff9dc4222af95d376b21268b_icgraph" id="group__userinput_gaa4169b83ff9dc4222af95d376b21268b_icgraph">
<area shape="rect" id="node3" href="group__dispatching.html#gac0d79cc522d6f5cecf9f72ecc5ecceb8" title="_drush_invoke_hooks" alt="" coords="181,5,328,35"/><area shape="rect" id="node7" href="updatecode_8pm_8inc.html#a86e03f91bb50878663449ddf74b8658d" title="_pm_update_core" alt="" coords="192,539,317,568"/><area shape="rect" id="node11" href="config_8drush_8inc.html#a6258f151a3c27b586409d46f1799a666" title="drush_config_export" alt="" coords="185,112,324,141"/><area shape="rect" id="node13" href="config_8drush_8inc.html#aef4c2b9a90b1297e0e60e741bace5a4e" title="drush_config_import" alt="" coords="185,165,324,195"/><area shape="rect" id="node15" href="config_8drush_8inc.html#a445c382afd7d7b9e7f6a7bad268c0d4d" title="drush_config_set" alt="" coords="195,219,315,248"/><area shape="rect" id="node17" href="group__commandprocessing.html#gaadd12f0ca081399dea1c99984c77e567" title="drush_do_multiple_command" alt="" coords="160,272,349,301"/><area shape="rect" id="node19" href="download_8pm_8inc.html#a802dd9a63e5ab3a3a8472d4635d3c662" title="drush_pm_download" alt="" coords="184,325,325,355"/><area shape="rect" id="node21" href="download_8pm_8inc.html#aa785bd2402492043b9acaee375c8ceeb" title="drush_pm_download_validate" alt="" coords="159,379,351,408"/><area shape="rect" id="node23" href="pm_8drush_8inc.html#aa99b7d46939c1f550211d2c09a72b977" title="drush_pm_enable" alt="" coords="193,432,316,461"/><area shape="rect" id="node25" href="pm_8drush_8inc.html#af9a0b321cd245d1e1f3424ae5c9acde9" title="drush_pm_enable_validate" alt="" coords="167,485,343,515"/><area shape="rect" id="node27" href="group__commandprocessing.html#gac5fea44d3fe064240192925f864d57a6" title="drush_preflight_command\l_dispatch" alt="" coords="169,805,340,851"/><area shape="rect" id="node31" href="sql_8drush_8inc.html#abf491ac1afcb96f58020dc2204094ebb" title="drush_sql_create" alt="" coords="195,592,315,621"/><area shape="rect" id="node33" href="sql_8drush_8inc.html#ac538b2fa7b1421461139b1a420531cba" title="drush_sql_drop" alt="" coords="200,645,309,675"/><area shape="rect" id="node35" href="sql_8drush_8inc.html#a9e45958fb554a3f6049ee18c857207af" title="drush_sql_sanitize" alt="" coords="189,699,320,728"/><area shape="rect" id="node37" href="user_8drush_8inc.html#a2a734fb7b01da25df72010674f07fb1d" title="drush_user_cancel" alt="" coords="189,752,320,781"/><area shape="rect" id="node39" href="make_8drush_8inc.html#ae117ecd8db6105b9778e7c6f5f74e40e" title="make_build_path" alt="" coords="195,875,315,904"/><area shape="rect" id="node45" href="updatecode_8pm_8inc.html#a604cbac2dc913cf35f3d4f7f79f4bc4b" title="pm_update_packages" alt="" coords="180,59,329,88"/><area shape="rect" id="node5" href="group__dispatching.html#gae7a7f1f4b8c5edffbc2ececc6638698a" title="drush_command" alt="" coords="424,5,541,35"/><area shape="rect" id="node9" href="updatecode_8pm_8inc.html#a7075f7486950df7a67f512a3533fef41" title="drush_pm_updatecode" alt="" coords="407,299,559,328"/><area shape="rect" id="node29" href="drush_8php.html#a2b642d2bbf815b6d80c315fd66b37381" title="drush_main" alt="" coords="439,813,527,843"/><area shape="rect" id="node41" href="make_8drush_8inc.html#a64e3d2b9948951c3f141802f41658359" title="drush_make" alt="" coords="436,924,529,953"/><area shape="rect" id="node43" href="make_8drush_8inc.html#adb3866751fd19344b00c069793f46322" title="drush_make_post_make" alt="" coords="401,871,564,900"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gabbb9a40c8f7e0ba5ec384ccf86305a20"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_prompt </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$prompt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$default</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$required</em> = <code>TRUE</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$password</em> = <code>FALSE</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Prompt the user for input</p>
<p>The input can be anything that fits on a single line (not only y/n), so we can't use <a class="el" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b">drush_confirm()</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$prompt</td><td>The text which is displayed to the user. </td></tr>
    <tr><td class="paramname">$default</td><td>The default value of the input. </td></tr>
    <tr><td class="paramname">$required</td><td>If TRUE, user may continue even when no value is in the input. </td></tr>
    <tr><td class="paramname">$password</td><td>If TRUE, surpress printing of the input.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b">drush_confirm()</a> </dd></dl>

<p>Definition at line <a class="el" href="drush_8inc_source.html#l00603">603</a> of file <a class="el" href="drush_8inc_source.html">drush.inc</a>.</p>

<p>References <a class="el" href="context_8inc_source.html#l00328">drush_get_context()</a>, <a class="el" href="output_8inc_source.html#l00045">drush_print_prompt()</a>, and <a class="el" href="exec_8inc_source.html#l00078">drush_shell_exec()</a>.</p>

<p>Referenced by <a class="el" href="field_8drush_8inc_source.html#l00361">drush_field_create_wizard()</a>, and <a class="el" href="user_8drush_8inc_source.html#l00349">drush_user_password()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_cgraph.png" border="0" usemap="#group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_cgraph" alt=""/></div>
<map name="group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_cgraph" id="group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_cgraph">
<area shape="rect" id="node3" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="1140,245,1268,275"/><area shape="rect" id="node5" href="group__outputfunctions.html#ga6dc4aa94bd0a854c564a2538e166c749" title="drush_print_prompt" alt="" coords="325,389,459,419"/><area shape="rect" id="node16" href="group__commandwrappers.html#gafd358ceac1286dbdd141ff2b8eb7d556" title="drush_shell_exec" alt="" coords="155,285,277,315"/><area shape="rect" id="node7" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740" title="drush_print" alt="" coords="789,337,875,367"/><area shape="rect" id="node9" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8" title="drush_get_option" alt="" coords="959,337,1079,367"/><area shape="rect" id="node11" href="context_8inc.html#aee5781894bf828bfa508d9052553f809" title="_drush_get_option" alt="" coords="1140,324,1268,353"/><area shape="rect" id="node13" href="context_8inc.html#a9f6272c1a68141ce873c07aae3a316ac" title="drush_context_names" alt="" coords="1129,377,1279,407"/><area shape="rect" id="node18" href="group__commandwrappers.html#ga0eed47c4d6d19d386936ad57f34b10b2" title="_drush_shell_exec" alt="" coords="327,285,457,315"/><area shape="rect" id="node20" href="group__commandwrappers.html#gafc52f7e769d935b4d2462467cdf8d5ee" title="drush_escapeshellarg" alt="" coords="533,143,680,172"/><area shape="rect" id="node30" href="group__commandwrappers.html#ga3a1bb3ae751f14749ce1dbe4ec9c3288" title="drush_shell_proc_open" alt="" coords="529,285,684,315"/><area shape="rect" id="node34" href="group__commandwrappers.html#gac21dc9409bff5197d255978c3cf6e761" title="_drush_shell_exec_output_set" alt="" coords="508,389,705,419"/><area shape="rect" id="node22" href="includes_2environment_8inc.html#a88114295372bcb0ca8dbb5f10b36368e" title="drush_is_windows" alt="" coords="768,112,896,141"/><area shape="rect" id="node24" href="group__commandwrappers.html#gac60b4740ceccf95b8e60d1896d93d2ab" title="_drush_escapeshellarg\l_windows" alt="" coords="755,165,909,211"/><area shape="rect" id="node26" href="group__commandwrappers.html#ga561ce790cc15caa5e1f0bfebc2546529" title="_drush_escapeshellarg\l_linux" alt="" coords="755,42,909,89"/></map>
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_icgraph.png" border="0" usemap="#group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_icgraph" alt=""/></div>
<map name="group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_icgraph" id="group__userinput_gabbb9a40c8f7e0ba5ec384ccf86305a20_icgraph">
<area shape="rect" id="node3" href="field_8drush_8inc.html#a3e930ec03cf0c5762790d73681f71f8f" title="drush_field_create\l_wizard" alt="" coords="165,5,293,51"/><area shape="rect" id="node5" href="user_8drush_8inc.html#a8efd948edf12d0eb6b083980b3d8257f" title="drush_user_password" alt="" coords="155,75,304,104"/></map>
</div>
</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 8 2014 09:05:00 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>