protecting log rotation with a mutex
[yaz-moved-to-github.git] / doc / yaz-client-commands.xml
1 <!-- 
2    $Id: yaz-client-commands.xml,v 1.5 2004-09-22 19:22:08 adam Exp $
3    Commands for YAZ client.
4    Included in both manual and man page for yaz-client.
5 -->
6 <variablelist>
7  <varlistentry><term>
8    <literal>open </literal><replaceable>zurl</replaceable>
9   </term>
10   <listitem>
11    <para>Opens a connection to a server. The syntax for
12     <replaceable>zurl</replaceable> is the same as described
13     above for connecting from the command line.
14    </para>
15    <para>
16     Syntax:
17    </para>
18    <para>
19     [<literal>(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
20     [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
21    </para>
22   </listitem>
23  </varlistentry>
24  <varlistentry><term>
25    <literal>quit</literal>
26   </term>
27   <listitem>
28    <para>Quits YAZ client</para>
29   </listitem>
30  </varlistentry>
31  <varlistentry><term>
32    <literal>f </literal><replaceable>query</replaceable></term>
33   <listitem>
34    <para>Sends a Search Request using the <replaceable>query</replaceable>
35     given.
36    </para>
37   </listitem>
38  </varlistentry>
39  <varlistentry><term>
40    <literal>delete</literal> <replaceable>setname</replaceable></term>
41   <listitem>
42    <para>Deletes result set with name <replaceable>setname</replaceable>
43     on the server.</para>
44   </listitem>
45  </varlistentry>
46  <varlistentry><term>
47    <literal>base </literal><replaceable>base1</replaceable>
48    <replaceable>base2</replaceable> ...
49   </term>
50   <listitem>
51    <para>Sets the name(s) of the database(s) to search. One or more
52     databases may be specified separated by blanks. This commands overrides
53     the database given in <replaceable>zurl</replaceable>.
54    </para>
55   </listitem>
56  </varlistentry>
57  <varlistentry><term>
58    <literal>show </literal>
59    [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
60   </term>
61   <listitem>
62    <para>Fetches records by sending a Present Request from the start
63     position given by
64     <replaceable>start</replaceable>
65     a number of records given by <replaceable>number</replaceable>. If
66     <replaceable>start</replaceable> is not given, then the client
67     will fetch from position of the last retrieved record plus 1. If
68     <replaceable>number</replaceable> is not given, then one record will
69     be fetched at a time.
70    </para>
71   </listitem>
72  </varlistentry>
73  <varlistentry><term>
74    <literal>scan</literal> <replaceable>term</replaceable>
75   </term>
76   <listitem>
77    <simpara>Scans
78     database index for a term. The syntax resembles the syntax
79     for <literal>find</literal>.
80     If you want to scan for the word <literal>water</literal> you could
81     write
82    </simpara>
83    <screen>
84     scan water
85    </screen>
86    <simpara>
87     but if you want to scan only in, say the title field, you would write
88    </simpara>
89    <screen>
90     scan @attr 1=4 water
91    </screen>
92   </listitem>
93  </varlistentry>
94  <varlistentry><term>
95    <literal>scanpos</literal> <replaceable>pos</replaceable>
96   </term>
97   <listitem>
98    <simpara>
99     Sets preferred position for scan. This value
100     is used in next scan. By default position is 1.
101    </simpara>
102   </listitem>
103  </varlistentry>
104  <varlistentry><term>
105    <literal>scanstep</literal> <replaceable>step</replaceable>
106   </term>
107   <listitem>
108    <simpara>
109     Set step-size for scan. This value is used in next scan
110     sent to the target. By default step-size is 0.
111    </simpara>
112   </listitem>
113  </varlistentry>
114  <varlistentry id="sortspec"><term>
115    <literal>sort</literal> <replaceable>sortspecs</replaceable>
116   </term>
117   <listitem>
118    <para>Sorts a result set. The sort command takes a
119     sequence of sort specifications. A sort
120     specification holds a field (sort criteria) and is followed by flags.
121     If the sort criteria includes <literal>=</literal> it is assumed
122     that the sort SortKey is of type sortAttributes using Bib-1.
123     The integer before <literal>=</literal> is
124     the attribute type and the integer following <literal>=</literal>
125     is the attribute value.
126     If no <literal>=</literal> is in the SortKey it is treated as a
127     sortfield-type of type InternationalString.
128     Flags observed are: <literal>s</literal>
129     for case sensitive, <literal>i</literal> for case insensitive,
130     <literal>&lt;</literal> for sort ascending and <literal>&gt;</literal>
131     for sort descending.
132    </para>
133   </listitem>
134  </varlistentry>
135  <varlistentry><term>
136    <literal>sort+</literal>
137   </term>
138   <listitem>
139    <para>Same as <literal>sort</literal> but stores the sorted
140     result set in a new result set.
141    </para>
142   </listitem>
143  </varlistentry>
144  <varlistentry><term>
145    <literal>authentication</literal> <replaceable>openauth</replaceable>
146   </term>
147   <listitem>
148    <para>Sets up a authentication string if a server requires
149     authentication (v2 OpenStyle). The authentication string is first
150     sent to the server when the <literal>open</literal> command is
151     issued and the Z39.50 Initialize Request is sent, so this command
152     must be used before <literal>open</literal> in order to be effective.
153     A common convention for the <replaceable>authopen</replaceable> string
154     is that the username - and password is separated by a slash, e.g.
155     <literal>myusername/mysecret</literal>.
156    </para>
157   </listitem>
158  </varlistentry>
159  <varlistentry><term>
160    <literal>lslb</literal> <replaceable>n</replaceable>
161   </term>
162   <listitem>
163    <para>Sets the limit for when no records should be returned
164     together with the search result.
165     See the
166     <ulink
167            url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
168      Z39.50 standard
169     </ulink>
170     for more details.
171    </para>
172   </listitem>
173  </varlistentry>
174
175  <varlistentry><term>
176    <literal>ssub</literal> <replaceable>n</replaceable>
177   </term>
178   <listitem>
179    <para>Sets the limit for when all records should be returned with
180     the search result.
181     See the
182     <ulink
183            url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
184      Z39.50 standard
185     </ulink> for more details.
186    </para>
187   </listitem>
188  </varlistentry>
189  
190  <varlistentry><term>
191    <literal>mspn</literal> <replaceable>n</replaceable>
192   </term>
193   <listitem>
194    <para>Sets the number of records should be returned if the
195     number of records in the result set is between the values of
196     <literal>lslb</literal> and <literal>ssub</literal>.
197     See the
198     <ulink
199            url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
200      Z39.50 standard
201     </ulink>
202     for more details.
203    </para>
204   </listitem>
205  </varlistentry>
206  <varlistentry><term>
207    <literal>status</literal>
208   </term>
209   <listitem>
210    <para>Displays the values of <literal>lslb</literal>,
211     <literal>ssub</literal> and <literal>mspn</literal>.
212    </para>
213   </listitem>
214  </varlistentry>
215  <varlistentry><term>
216    <literal>setname</literal>
217   </term>
218   <listitem>
219    <para>Switches named result sets on and off. Default is on.
220    </para>
221   </listitem>
222  </varlistentry>
223  <varlistentry><term>
224    <literal>cancel</literal>
225   </term>
226   <listitem>
227    <para>Sends a Trigger Resource Control Request to the target.
228    </para>
229   </listitem>
230  </varlistentry>
231  <varlistentry><term>
232    <literal>format</literal> <replaceable>oid</replaceable>
233   </term>
234   <listitem>
235    <para>Sets the preferred transfer syntax for retrieved records.
236     yaz-client supports all the record syntaxes that currently
237     are registered. See
238     <ulink
239            url="http://lcweb.loc.gov/z3950/agency/defns/oids.html#5">
240      Z39.50 Standard
241     </ulink>
242     for more details. Commonly used records syntaxes include usmarc,
243     sutrs, grs1 and xml.
244    </para>
245   </listitem>
246  </varlistentry>
247  <varlistentry><term>
248    <literal>elements</literal> <replaceable>e</replaceable>
249   </term>
250   <listitem>
251    <para>Sets the element set name for the records. Many targets support
252     element sets are B (for brief) and F (for full).
253    </para>
254   </listitem>
255  </varlistentry>
256  <varlistentry><term>
257    <literal>close</literal>
258   </term>
259   <listitem>
260    <para>Sends a Z39.50 Close APDU and closes connection with the peer
261    </para>
262   </listitem>
263  </varlistentry>
264  <varlistentry><term>
265    <literal>querytype</literal> <replaceable>type</replaceable>
266   </term>
267   <listitem>
268    <para>Sets the query type as used by command <literal>find</literal>.
269     The following is supported:
270     <literal>prefix</literal> for
271         <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
272     <literal>ccl</literal> for CCL search (Type-2 Query),
273     <literal>cql</literal> for CQL (Type-104 search with CQL OID),
274     <literal>ccl2rpn</literal> for
275         <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
276     <literal>cql2rpn</literal> for
277         CQL to RPN conversion (Type-1 Query).
278    </para>
279   </listitem>
280  </varlistentry>
281  <varlistentry><term>
282    <literal>attributeset</literal> <replaceable>set</replaceable>
283   </term>
284   <listitem>
285    <para>
286     Sets attribute set OID for prefix queries (RPN, Type-1).
287    </para>
288   </listitem>
289  </varlistentry>
290  <varlistentry><term>
291    <literal>refid</literal> <replaceable>id</replaceable>
292   </term>
293   <listitem>
294    <para>Sets reference ID for Z39.50 Request(s).
295    </para>
296   </listitem>
297  </varlistentry>
298  <varlistentry><term>
299    <literal>itemorder</literal>
300    <replaceable>type</replaceable> <replaceable>no</replaceable>
301   </term>
302   <listitem>
303    <para>Sends an Item Order Request using the ILL External. 
304     <replaceable>type</replaceable> is either 1 or 2 which corresponds to
305     ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
306     is the Result Set position of the record to be ordered.
307    </para>
308   </listitem>
309  </varlistentry>
310  <varlistentry><term>
311    <literal>update</literal>
312   </term>
313   <listitem>
314    <para>Sends Item Update Request. This command sends a "minimal"
315     PDU Update to the target supplying the last received record from
316     the target.
317     If no record has been received from the target this command is ignored
318     and nothing is sent to the target.
319    </para>
320   </listitem>
321  </varlistentry>
322
323  <varlistentry><term>
324    <literal>.</literal>
325    <replaceable>filename</replaceable>
326   </term>
327   <listitem>
328    <para>Executes list of commands from
329     file <replaceable>filename</replaceable>, just like source on
330     most UNIX shells.
331    </para>
332   </listitem>
333  </varlistentry>
334
335  <varlistentry><term>
336    <literal>!</literal>
337    <replaceable>args</replaceable>
338   </term>
339   <listitem>
340    <para>Executes command <replaceable>args</replaceable> in subshell
341     using the <literal>system</literal> call.
342    </para>
343   </listitem>
344  </varlistentry>
345
346  <varlistentry><term>
347    <literal>push_commande</literal>
348    <replaceable>command</replaceable>
349   </term>
350   <listitem>
351    <para>The push_command takes another command as its argument.
352     That command is then added to the history information (so
353     you can retrieve it later). The command itself is not
354     executed. This command only works if you have GNU readline/history
355     enabled.
356    </para>
357   </listitem>
358  </varlistentry>
359
360  <varlistentry><term>
361    <literal>set_apdufile</literal>
362    <replaceable>filename</replaceable>
363   </term>
364   <listitem>
365    <para>Sets that APDU should be logged to file
366     <replaceable>filename</replaceable>. This command does the
367     thing as option <literal>-a</literal>.
368    </para>
369   </listitem>
370  </varlistentry>
371
372  <varlistentry><term>
373    <literal>set_marcdump</literal>
374    <replaceable>filename</replaceable>
375   </term>
376   <listitem>
377    <para>Specifies that all retrieved records should be appended ot
378     file <replaceable>filename</replaceable>. This command does the
379     thing as option <literal>-m</literal>.
380    </para>
381   </listitem>
382  </varlistentry>
383
384  <varlistentry><term>
385    <literal>schema</literal>
386    <replaceable>schemaid</replaceable>
387   </term>
388   <listitem>
389    <para>Specifies schema for retrieval.
390     Schema may be specified as an OID for Z39.50.
391     For SRW, schema is a simple string URI.
392    </para>
393   </listitem>
394  </varlistentry>
395
396  <varlistentry><term>
397    <literal>charset</literal>
398    <replaceable>negotiationcharset</replaceable>
399    [<replaceable>outputcharset</replaceable>]
400   </term>
401   <listitem>
402    <para>Specifies character set (encoding) for Z39.50
403     negotiation / SRW encoding and/or character set for output (terminal).
404    </para>
405    <para>
406     <replaceable>negotiationcharset</replaceable> is the name
407     of the character set to be negotiated by the server. The special name
408     <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
409     specifies <emphasis>no</emphasis> character set to be negotiated.
410    </para>
411    <para>
412     If <replaceable>outputcharset</replaceable> is given, it specifies name
413     of the character set of the output (on the terminal on which
414     YAZ client is running). To disable conversion of characters
415     to the output encoding, the special name <literal>-</literal> (dash)
416     can be used.
417     If the special name <literal>auto</literal> is given, YAZ client will
418     convert strings to the encoding of the
419     terminal as returned by <function>nl_langinfo</function> call.
420    </para>
421    <note>
422     <para>
423      Since character set negotation takes effect in the Z39.50
424      Initialize Request you should issue this command before
425      command <literal>open</literal> is used.
426     </para>
427    </note>
428    <note>
429     <para>
430      MARC records are not covered by Z39.50 character set negotiation.
431      See <literal>marccharset</literal>.
432     </para>
433    </note>
434   </listitem>
435  </varlistentry>
436
437  <varlistentry><term>
438    <literal>marccharset</literal>
439    <replaceable>charset</replaceable>
440   </term>
441   <listitem>
442    <para>Specifies character set for retrieved MARC records so
443     that YAZ client can display them in a character suitable
444     for your display. See <literal>charset</literal> command.
445     If <literal>auto</literal> is given, YAZ will assume
446     that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
447     for all other MARC variants.
448    </para>
449   </listitem>
450  </varlistentry>
451
452  <varlistentry><term>
453    <literal>set_cclfields</literal>
454    <replaceable>filename</replaceable>
455   </term>
456   <listitem>
457    <para>Specifies that CCL fields should be read from file
458     file <replaceable>filename</replaceable>. This command does the
459     thing as option <literal>-c</literal>.
460    </para>
461   </listitem>
462  </varlistentry>
463
464  <varlistentry><term>
465    <literal>set_cqlfields</literal>
466    <replaceable>filename</replaceable>
467   </term>
468   <listitem>
469    <para>Specifies that CQL fields should be read from file
470     file <replaceable>filename</replaceable>. This command does the
471     thing as option <literal>-q</literal>.
472    </para>
473   </listitem>
474  </varlistentry>
475
476  <varlistentry><term>
477    <literal>register_oid</literal>
478    <replaceable>name</replaceable>
479    <replaceable>class</replaceable>
480    <replaceable>OID</replaceable>
481   </term>
482   <listitem>
483    <para>This command allows you to register your own object
484     identifier - so that instead of entering a long dot-notation
485     you can use a short name instead.
486     The <replaceable>name</replaceable> is your
487     name for the OID, <replaceable>class</replaceable> is the
488     class, and <replaceable>OID</replaceable> is the raw OID in
489     dot notation. Class is one <literal>appctx</literal>,
490     <literal>absyn</literal>, <literal>attet</literal>,
491     <literal>transyn</literal>, <literal>diagset</literal>,
492     <literal>recsyn</literal>, <literal>resform</literal>,
493     <literal>accform</literal>, <literal>extserv</literal>,
494     <literal>userinfo</literal>, <literal>elemspec</literal>,
495     <literal>varset</literal>, <literal>schema</literal>,
496     <literal>tagset</literal>, <literal>general</literal>.
497     If you're in doubt use the <literal>general</literal>
498     class.
499    </para>
500   </listitem>
501  </varlistentry>
502  
503 </variablelist>
504 <!-- Keep this comment at the end of the file
505 Local variables:
506 mode: sgml
507 sgml-omittag:t
508 sgml-shorttag:t
509 sgml-minimize-attributes:nil
510 sgml-always-quote-attributes:t
511 sgml-indent-step:1
512 sgml-indent-data:t
513 sgml-parent-document: "yaz.xml"
514 sgml-local-catalogs: nil
515 sgml-namecase-general:t
516 End:
517 -->