2 <listitem id="command_version">
5 <parameter>number</parameter>
8 This exchanges with the frontend the protocol version number that is
9 being used. The current version is 2.1. Versions in the 2.x series
10 will be backwards-compatible. You may specify the protocol version
11 number you are speaking. The frontend will return the version of the
12 protocol it speaks. If the version you specify is too low, this
13 command will return the numeric return code <literal>30</literal>.
16 <listitem id="command_capb">
19 <parameter>capabilities</parameter>
22 This exchanges with the frontend a list of supported capabilities
23 Capabilities both the frontend and your confmodule support may be
24 used; the capabilities supported by the frontend are returned by
27 <title>Currently used capabilities</title>
31 <entry>capability</entry>
32 <entry>description</entry>
39 Backing up to a previous step is supported.
45 The frontend expects commands sent to it to have
46 backslashes and newlines quoted as <literal>\\</literal>
47 and <literal>\n</literal> respectively and will in turn
48 quote backslashes and newlines in its replies. See
49 <citerefentry><refentrytitle>debconf-escape</refentrytitle>
50 <manvolnum>1</manvolnum></citerefentry>.
54 <entry>multiselect</entry>
56 The multiselect data type is supported. You do not need to
57 check this capability if you depend on any modern version
66 <listitem id="command_settitle">
69 <parameter>template</parameter>
72 You can use this command to set a title in the frontend. This may
73 appear in different ways, depending on the frontend being used, for
74 example it might change the title of the frontend's window. If you
75 don't specify anything, a title will automatically be generated.
78 Using a template has the advantage that titles are translatable and
79 that they can be maintained in the same place as other text
83 <listitem id="command_title">
86 <parameter>string</parameter>
89 Similar to SETTITLE, but takes a string instead of a template as
90 parameter. Consequence is that the title will not be translatable,
91 unless some other mechanism (like gettext) is used.
94 <listitem id="command_stop">
99 This command tells the frontend you're done talking to it. Typically
100 the frontend can detect the termination of your program and this
101 command is not necessary.
104 <listitem id="command_input">
107 <parameter>priority</parameter>
108 <parameter>question</parameter>
111 This tells the frontend to display a question (or other type of
112 item) to the user. <parameter>question</parameter> is the name of
113 the item to display, all other information about the item is
114 retrieved from the templates described previously.
115 <parameter>priority</parameter> is how important it is that the user
116 be prompted. The frontend need only ask this question if the
117 priority is high enough. The question is not displayed until a go
118 command is given. This allows us to ask multiple questions in a
119 single screen. Once a question has been displayed to the user and
120 the user has provided input, the frontend will set the
121 <literal>seen</literal> flag.
125 Note that the frontend decides if the user is actually prompted or
126 not. If the user has already answered a question, they are normally
127 not asked it again even if input is called again. And if the user is
128 ignoring low priority items, they will not see them. In either of
129 these cases, this command returns the numeric return code
130 <literal>30</literal>.
133 <listitem id="command_beginblock">
138 <listitem id="command_endblock">
143 Some frontends are able to display a number of items to the user at
144 once. To do this, they need to be given blocks of input commands,
145 enclosed in the BEGINBLOCK and ENDBLOCK commands. Blocks can be
146 nested and very advanced frontends may use this as a user interface
151 There is an implicit block around any set of INPUT commands that
152 are not enclosed in an explicit block.
156 <listitem id="command_go">
161 Shows the current set of accumulated items to the user and lets them
162 fill in values, etc. If the backup capability is supported and the
163 user indicates they want to back up a step, this command returns the
164 numeric return code <literal>30</literal>.
167 <listitem id="command_clear">
172 Clears the accumulated set of INPUT commands without displaying them
176 <listitem id="command_get">
178 GET <parameter>question</parameter>
181 Ask the frontend to tell you how the user answered a question. The
182 value is returned to you.
185 <listitem id="command_set">
188 <parameter>question</parameter>
189 <parameter>value</parameter>
192 Set the answer of a question to a value.
195 <listitem id="command_reset">
197 RESET <parameter>question</parameter>
200 Reset the question to its default value. This includes resetting
201 flags to their defaults.
204 <listitem id="command_subst">
207 <parameter>question</parameter>
208 <parameter>key</parameter>
209 <parameter>value</parameter>
212 Questions (and other items) can have substitutions embedded in their
213 descriptions (and, currently in their choices fields). These
214 substitutions look like "<literal>${key}</literal>". When the
215 question is displayed, the substitutions are replaced with their
216 values. This command can be used to set the value of a substitution.
219 <listitem id="command_fget">
222 <parameter>question</parameter>
223 <parameter>flag</parameter>
226 Questions (and other items) can have flags associated with them. The
227 flags have a value of "<literal>true</literal>" or
228 "<literal>false</literal>". This command returns the value of a
232 <listitem id="command_fset">
235 <parameter>question</parameter>
236 <parameter>flag</parameter>
237 <parameter>value</parameter>
240 This sets the state of a flag on a question. Valid states for the
241 flag are "<literal>true</literal>" and "<literal>false</literal>".
244 One common flag is the "<literal>seen</literal>" flag. It is
245 normally only set if a user already seen a question. Typically,
246 frontends only display questions to users if they have the seen flag
247 set to "false". Sometimes you want the user to see a question again
248 -- in these cases you can set the seen flag to false to force the
249 frontend to redisplay it.
252 Note that as a special convenience behavior, frontends will
253 redisplay already seen questions if the question was first seen by
254 the user in the same confmodule run. This makes it easy for a
255 confmodule to back up to previous questions without having to reset
259 <listitem id="command_metaget">
262 <parameter>question</parameter>
263 <parameter>field</parameter>
266 This returns the value of any field of a question (the description,
270 <listitem id="command_register">
273 <parameter>template</parameter>
274 <parameter>question</parameter>
277 This creates a new question that is bound to a template. By default
278 each template has an associated question with the same
279 name. However, any number of questions can really be associated with
280 a template, and this lets you create more such questions.
283 <listitem id="command_unregister">
286 <parameter>question</parameter>
289 This removes a question from the database.
292 <listitem id="command_purge">
297 Call this in your postrm when your package is purged. It removes all
298 templates and questions your package has generated.