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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
|
<itemizedlist>
<listitem id="command_version">
<para>
VERSION
<parameter>number</parameter>
</para>
<para>
This exchanges with the frontend the protocol version number that is
being used. The current version is 2.1. Versions in the 2.x series
will be backwards-compatible. You may specify the protocol version
number you are speaking. The frontend will return the version of the
protocol it speaks. If the version you specify is too low, this
command will return the numeric return code <literal>30</literal>.
</para>
</listitem>
<listitem id="command_capb">
<para>
CAPB
<parameter>capabilities</parameter>
</para>
<para>
This exchanges with the frontend a list of supported capabilities
Capabilities both the frontend and your confmodule support may be
used; the capabilities supported by the frontend are returned by
this command.
<table frame="all">
<title>Currently used capabilities</title>
<tgroup cols="2">
<thead>
<row>
<entry>capability</entry>
<entry>description</entry>
</row>
</thead>
<tbody>
<row>
<entry>backup</entry>
<entry>
Backing up to a previous step is supported.
</entry>
</row>
<row>
<entry>escape</entry>
<entry>
The frontend expects commands sent to it to have
backslashes and newlines quoted as <literal>\\</literal>
and <literal>\n</literal> respectively and will in turn
quote backslashes and newlines in its replies. See
<citerefentry><refentrytitle>debconf-escape</refentrytitle>
<manvolnum>1</manvolnum></citerefentry>.
</entry>
</row>
<row>
<entry>multiselect</entry>
<entry>
The multiselect data type is supported. You do not need to
check this capability if you depend on any modern version
of debconf.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
<listitem id="command_settitle">
<para>
SETTITLE
<parameter>template</parameter>
</para>
<para>
You can use this command to set a title in the frontend. This may
appear in different ways, depending on the frontend being used, for
example it might change the title of the frontend's window. If you
don't specify anything, a title will automatically be generated.
</para>
<para>
Using a template has the advantage that titles are translatable and
that they can be maintained in the same place as other text
displayed to users.
</para>
</listitem>
<listitem id="command_title">
<para>
TITLE
<parameter>string</parameter>
</para>
<para>
Similar to SETTITLE, but takes a string instead of a template as
parameter. Consequence is that the title will not be translatable,
unless some other mechanism (like gettext) is used.
</para>
</listitem>
<listitem id="command_stop">
<para>
STOP
</para>
<para>
This command tells the frontend you're done talking to it. Typically
the frontend can detect the termination of your program and this
command is not necessary.
</para>
</listitem>
<listitem id="command_input">
<para>
INPUT
<parameter>priority</parameter>
<parameter>question</parameter>
</para>
<para>
This tells the frontend to display a question (or other type of
item) to the user. <parameter>question</parameter> is the name of
the item to display, all other information about the item is
retrieved from the templates described previously.
<parameter>priority</parameter> is how important it is that the user
be prompted. The frontend need only ask this question if the
priority is high enough. The question is not displayed until a go
command is given. This allows us to ask multiple questions in a
single screen. Once a question has been displayed to the user and
the user has provided input, the frontend will set the
<literal>seen</literal> flag.
&priority_table;
</para>
<para>
Note that the frontend decides if the user is actually prompted or
not. If the user has already answered a question, they are normally
not asked it again even if input is called again. And if the user is
ignoring low priority items, they will not see them. In either of
these cases, this command returns the numeric return code
<literal>30</literal>.
</para>
</listitem>
<listitem id="command_beginblock">
<para>
BEGINBLOCK
</para>
</listitem>
<listitem id="command_endblock">
<para>
ENDBLOCK
</para>
<para>
Some frontends are able to display a number of items to the user at
once. To do this, they need to be given blocks of input commands,
enclosed in the BEGINBLOCK and ENDBLOCK commands. Blocks can be
nested and very advanced frontends may use this as a user interface
hint.
</para>
<note>
<para>
There is an implicit block around any set of INPUT commands that
are not enclosed in an explicit block.
</para>
</note>
</listitem>
<listitem id="command_go">
<para>
GO
</para>
<para>
Shows the current set of accumulated items to the user and lets them
fill in values, etc. If the backup capability is supported and the
user indicates they want to back up a step, this command returns the
numeric return code <literal>30</literal>.
</para>
</listitem>
<listitem id="command_clear">
<para>
CLEAR
</para>
<para>
Clears the accumulated set of INPUT commands without displaying them
to the user.
</para>
</listitem>
<listitem id="command_get">
<para>
GET <parameter>question</parameter>
</para>
<para>
Ask the frontend to tell you how the user answered a question. The
value is returned to you.
</para>
</listitem>
<listitem id="command_set">
<para>
SET
<parameter>question</parameter>
<parameter>value</parameter>
</para>
<para>
Set the answer of a question to a value.
</para>
</listitem>
<listitem id="command_reset">
<para>
RESET <parameter>question</parameter>
</para>
<para>
Reset the question to its default value. This includes resetting
flags to their defaults.
</para>
</listitem>
<listitem id="command_subst">
<para>
SUBST
<parameter>question</parameter>
<parameter>key</parameter>
<parameter>value</parameter>
</para>
<para>
Questions (and other items) can have substitutions embedded in their
descriptions (and, currently in their choices fields). These
substitutions look like "<literal>${key}</literal>". When the
question is displayed, the substitutions are replaced with their
values. This command can be used to set the value of a substitution.
</para>
</listitem>
<listitem id="command_fget">
<para>
FGET
<parameter>question</parameter>
<parameter>flag</parameter>
</para>
<para>
Questions (and other items) can have flags associated with them. The
flags have a value of "<literal>true</literal>" or
"<literal>false</literal>". This command returns the value of a
flag.
</para>
</listitem>
<listitem id="command_fset">
<para>
FSET
<parameter>question</parameter>
<parameter>flag</parameter>
<parameter>value</parameter>
</para>
<para>
This sets the state of a flag on a question. Valid states for the
flag are "<literal>true</literal>" and "<literal>false</literal>".
</para>
<para>
One common flag is the "<literal>seen</literal>" flag. It is
normally only set if a user already seen a question. Typically,
frontends only display questions to users if they have the seen flag
set to "false". Sometimes you want the user to see a question again
-- in these cases you can set the seen flag to false to force the
frontend to redisplay it.
</para>
<para>
Note that as a special convenience behavior, frontends will
redisplay already seen questions if the question was first seen by
the user in the same confmodule run. This makes it easy for a
confmodule to back up to previous questions without having to reset
the seen flag.
</para>
</listitem>
<listitem id="command_metaget">
<para>
METAGET
<parameter>question</parameter>
<parameter>field</parameter>
</para>
<para>
This returns the value of any field of a question (the description,
for example).
</para>
</listitem>
<listitem id="command_register">
<para>
REGISTER
<parameter>template</parameter>
<parameter>question</parameter>
</para>
<para>
This creates a new question that is bound to a template. By default
each template has an associated question with the same
name. However, any number of questions can really be associated with
a template, and this lets you create more such questions.
</para>
</listitem>
<listitem id="command_unregister">
<para>
UNREGISTER
<parameter>question</parameter>
</para>
<para>
This removes a question from the database.
</para>
</listitem>
<listitem id="command_purge">
<para>
PURGE
</para>
<para>
Call this in your postrm when your package is purged. It removes all
templates and questions your package has generated.
</para>
</listitem>
</itemizedlist>
|