forked from drush-ops/drush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrict-options.html
35 lines (33 loc) · 1.61 KB
/
strict-options.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<h1>Strict Option Handling</h1>
<p>
Some Drush commands use strict option handling; these commands require
that all Drush global option appear on the command line before the Drush
command name.
<p>
One example of this is the core-rsync command:
<p>
<pre>
drush --simulate core-rsync -v @site1 @site2
</pre>
The --simulate option is a Drush global option that causes Drush to
print out what it would do if the command is executed, without actually
taking any action. Commands such as core-rsync that use strict option
handling require that --simulate, if used, must appear before the command
name. Most Drush commands allow the --simulate to be placed anywhere,
such as at the end of the command line.
<p>
The -v option above is an rsync option. In this usage, it will cause
the rsync command to run in verbose mode. It will not cause Drush to
run in verbose mode, though, because it appears after the core-rsync
command name. Most Drush commands would be run in verbose mode if a
-v option appeared in the same location.
<p>
The advantage of strict option handling is that it allows Drush to
pass options and arguments through to a shell command. Some shell commands,
such as rsync and ssh, either have options that cannot be represented
in Drush. For example, rsync allows the --exclude option to appear multiple
times on the command line, but Drush only allows one instance of an
option at a time for most Drush commands. Strict option handling overcomes
this limitation, plus possible conflict between Drush options and
shell command options with the same name, at the cost of greater restriction
on where global options can be placed.