diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-07 14:57:32 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-07 15:16:14 +0200 |
commit | 5a7b73860974384d8e00065105435403b0842ab0 (patch) | |
tree | 3f029c22f0a29a842002279bb4b5561af61a8aa8 /doc/eclat.conf.5 | |
parent | c12cd5695cf1a6c2c44100a68762ab66356f43b8 (diff) | |
download | eclat-5a7b73860974384d8e00065105435403b0842ab0.tar.gz eclat-5a7b73860974384d8e00065105435403b0842ab0.tar.bz2 |
Re-implement confirmation support.
* doc/eclat-delete-volume.1: Update.
* doc/eclat-release-address.1: Update.
* doc/eclat.1: Update.
* doc/eclat.conf.5: New section "CONFIRMATION"
* lib/getyn.c (eclat_vgetyn): Negative default stands for no
default at all.
* lib/confirm.c (eclat_confirm_mode): Remove.
(eclat_confirm): Change signature. Act according to the
first argument.
* lib/libeclat.h (eclat_confirm_mode): New enum.
(eclat_confirm): Change signature.
* src/cmdline.opt: Change handling of -Y and -N options.
* src/config.c: New statement "confirm".
* src/cretags.c: Remove call to eclat_confirm. This is done by
the caller.
* src/delvol.c: Likewise.
* src/reladdr.c: Likewise.
* src/eclat.c (confirm_mode): New variable.
(command) <flags>: New member.
(cmdtab): Mark commands with appropriate flags.
(main): Call eclat_confirm to confirm the command.
* src/eclat.h (confirm_mode): New extern.
(set_command_confirmation): New proto.
* etc/eclat.cfin: Set a reasonably safe confirmation default.
* lib/forlan.c (strtots): Remove unused variable.
Diffstat (limited to 'doc/eclat.conf.5')
-rw-r--r-- | doc/eclat.conf.5 | 88 |
1 files changed, 87 insertions, 1 deletions
diff --git a/doc/eclat.conf.5 b/doc/eclat.conf.5 index 2a14e2e..d7599b7 100644 --- a/doc/eclat.conf.5 +++ b/doc/eclat.conf.5 @@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License .\" along with Eclat. If not, see <http://www.gnu.org/licenses/>. -.TH ECLAT.CONF 5 "October 16, 2012" "ECLAT" "Eclat User Reference" +.TH ECLAT.CONF 5 "December 7, 2012" "ECLAT" "Eclat User Reference" .SH NAME eclat.conf \- configuration file for .BR eclat (1). @@ -533,6 +533,92 @@ expansion. .IP \n+[step]. If the format cannot determined by the above steps, an error is reported and the program terminates. +.SH CONFIRMATION +Many +.B eclat +commands result in modification of your EC2 resources. Some of them +are destructive, in the sense that such modifications cannot be undone +(e.g. deleting of a volume or termination of an instance). To reduce +the possibility of careless usage, +.B eclat +can be configured to interactively ask for a confirmation when such a +command is requested. This is configured by the +.B confirm +statement: +.PP +.nf +.in +2 +\fBconfirm\fR \fImode\fR \fBcommand\fR; +\fBconfirm\fR \fImode\fR (\fBcommand\fR[, \fBcommand\fR...]); +\fBconfirm\fR \fImode\fR \fIclass\fR; +.fi +.PP +The \fImode\fR argument specifies the requested confirmation mode. +Its valid values are: +.TP +.B tty +Ask for confirmation if the controlling terminal is a tty, i.e. if +.B eclat +is started from the command line. +.TP +.B always +Always ask for confirmation. If the controlling terminal is not a +tty, abort the command. +.TP +.B positive +Never ask. Assume positive confirmation. This is the default. +.TP +.B negative +Never ask, assuming negative confirmation. +.PP +The second argument specifies the commands to which this mode is +applied. It can be a single command name or tag, a comma-separated +list of command names or tags, or a \fBclass\fR of commands. Valid +values for \fIclass\fR are: +.TP +.B all +All commands that modify EC2 resources. +.TP +.B destructive +Commands that destructively modify resources. +.PP +Consider the following example: +.PP +.nf +.in +2 +confirm tty destructive; +confirm tty (StopInstance, StartInstance); +.fi +.PP +It instructs +.B eclat +to ask for confirmation if one of the destructive commands is +requested, or if the command is start-instance or stop-instance. +.PP +Here is an example of how this modifies the behavior of +.B release-address +command: +.PP +.nf +.if +2 +$ \fBeclat release-address 192.168.0.1\fR +Proceed with release-address [Y/n] _ +.fi +.PP +If the response begins with \fBY\fR (case-insensitive), it is taken +for a positive answer, and the command will be executed. Otherwise, +.B eclat +exits returning code 16 to the shell. +.PP +The current confirmation setting can be overridden using the \fB\-Y\fR +(\fB\-\-yes\fR) or \fB\-N\fR (\fB\-\-no\fR) command line option. The +former forces \fBpositive\fN and the latter \fBnegative\fR +confirmation mode for the requested command, e.g.: +.PP +.nf +.in +2 +$ \fBeclat -Y delete-volume vol-d1234aef\fR +.fi .SH MAPS Maps provide a way to translate arbitrary symbolic names to the Amazon resource identifiers. See the section |