Version 4.1.0
[yaz-moved-to-github.git] / doc / yaz-client-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" 
2  "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="yaz-client">
12  <refentryinfo>
13   <productname>YAZ</productname>
14   <productnumber>&version;</productnumber>
15  </refentryinfo>
16  
17  <refmeta>
18   <refentrytitle>yaz-client</refentrytitle>
19   <manvolnum>1</manvolnum>
20  </refmeta>
21  
22  <refnamediv>
23   <refname>yaz-client</refname>
24   <refpurpose>Z39.50/SRU client for implementors</refpurpose>
25  </refnamediv>
26
27  <refsynopsisdiv>
28   <cmdsynopsis>
29    <command>yaz-client</command>
30    <arg choice="opt"><option>-a <replaceable>apdulog</replaceable></option></arg>
31    <arg choice="opt"><option>-b <replaceable>berdump</replaceable></option></arg>
32    <arg choice="opt"><option>-c <replaceable>cclfile</replaceable></option></arg>
33    <arg choice="opt"><option>-d <replaceable>dump</replaceable></option></arg>
34    <arg choice="opt"><option>-f <replaceable>cmdfile</replaceable></option></arg>
35    <arg choice="opt"><option>-k <replaceable>size</replaceable></option></arg>
36    <arg choice="opt"><option>-m <replaceable>marclog</replaceable></option></arg>
37    <arg choice="opt"><option>-p <replaceable>proxy-addr</replaceable></option></arg>
38    <arg choice="opt"><option>-q <replaceable>cqlfile</replaceable></option></arg>
39    <arg choice="opt"><option>-t <replaceable>dispcharset</replaceable></option></arg>
40    <arg choice="opt"><option>-u <replaceable>auth</replaceable></option></arg>
41    <arg choice="opt"><option>-v <replaceable>loglevel</replaceable></option></arg>
42    <arg choice="opt"><option>-V</option></arg>
43    <arg choice="opt"><option>-x</option></arg>
44    <arg choice="opt">server-addr</arg>
45   </cmdsynopsis>
46
47  </refsynopsisdiv>
48   
49  <refsect1><title>DESCRIPTION</title>
50   <para>
51    <command>yaz-client</command> is a
52    <ulink url="&url.z39.50;">Z39.50</ulink>/<ulink url="&url.sru;">SRU</ulink>
53    client (origin) with a simple command line interface that allows
54    you to test behavior and performance of Z39.50 targets and SRU servers.
55   </para>
56   <para>
57    From YAZ version 4.1.0 <command>yaz-client</command> may also operate as a
58    <ulink url="&url.solr;">SOLR</ulink> Web Service
59    client.
60   </para>
61   <para>
62    If the <replaceable>server-addr</replaceable> is specified, the client creates
63    a connection to the Z39.50/SRU target at the address given.
64   </para>
65   <para>
66    When <command>yaz-client</command> is started it tries to read
67    commands from one of the following files:
68    <itemizedlist>
69     <listitem><para>
70       Command file if it is given by option -f. 
71      </para></listitem>
72     <listitem><para>
73       <filename>.yazclientrc</filename> in current working directory.
74      </para></listitem>
75     <listitem><para>
76       <filename>.yazclientrc</filename> in the user's home directory.
77       The value of the <literal>HOME</literal> is used to determine
78       the home directory. Normally, <literal>HOME</literal> is only set
79       on POSIX systems such as Linux, FreeBSD, Solaris.
80      </para></listitem>
81    </itemizedlist>
82   </para>
83  </refsect1>
84   <refsect1>
85    <title>OPTIONS</title>
86    <variablelist>
87     <varlistentry>
88      <term>-a <replaceable>filename</replaceable></term>
89      <listitem><para>
90        If specified, logging of protocol packages will be appended
91        file given. If <replaceable>filename</replaceable> is
92        specified as <literal>-</literal>, the output is written
93        to <literal>stdout</literal>.
94       </para></listitem>
95     </varlistentry>
96     <varlistentry>
97      <term>-b <replaceable>filename</replaceable></term>
98      <listitem><para>
99        If specified, YAZ will dump BER data in readable notation
100        to the file specified. If <replaceable>filename</replaceable>
101        is specified as <literal>-</literal> the output is written
102        to <literal>stdout</literal>.
103       </para></listitem>
104     </varlistentry>
105     <varlistentry>
106      <term>-c <replaceable>filename</replaceable></term>
107      <listitem><para>
108        If specified, CCL configuration will be read from
109        the file given.
110       </para></listitem>
111     </varlistentry>
112     <varlistentry>
113      <term>-d <replaceable>dump</replaceable></term>
114      <listitem><para>
115        If specified, YAZ will dump BER data for all PDUs sent and received 
116        to individual files, named
117        <replaceable>dump</replaceable>.DDD.<literal>raw</literal>, 
118        where DDD is 001, 002, 003, ..
119       </para></listitem>
120     </varlistentry>
121
122     <varlistentry>
123      <term>-f <replaceable>cmdfile</replaceable></term>
124      <listitem><para>
125       Reads commands from <replaceable>cmdfile</replaceable>. When
126       this option is used, YAZ client does not read .yazclientrc
127       from current directory or home directory.
128       </para></listitem>
129     </varlistentry>
130
131     <varlistentry>
132      <term>-k <replaceable>size</replaceable></term>
133      <listitem><para>
134       Sets preferred messages and maximum record size for Initialize
135       Request in kilobytes. Default value is 1024 (1 MB).
136       </para></listitem>
137     </varlistentry>
138     <varlistentry>
139      <term>-m <replaceable>filename</replaceable></term>
140      <listitem><para>
141        If specified, retrieved records will be appended to the file given.
142       </para></listitem>
143     </varlistentry>
144     <varlistentry>
145      <term>-p <replaceable>proxy-addr</replaceable></term>
146      <listitem><para>
147        If specified, the client will use the proxy at the address
148        given. YAZ client will
149        connect to a proxy on the address and port given. 
150        The actual target will be specified as part of the InitRequest
151        to inform the proxy about actual target.
152       </para></listitem>
153     </varlistentry>
154     <varlistentry>
155      <term>-q <replaceable>filename</replaceable></term>
156      <listitem><para>
157        If specified, CQL configuration will be read from
158        the file given.
159       </para></listitem>
160     </varlistentry>
161     <varlistentry>
162      <term>-t <replaceable>displaycharset</replaceable></term>
163      <listitem><para>
164        If displaycharset is given, it specifies name of the character set of the
165        output (on the terminal on which YAZ client is running). 
166       </para></listitem>
167     </varlistentry>
168     <varlistentry>
169      <term>-u <replaceable>auth</replaceable></term>
170      <listitem><para>
171        If specified, the <replaceable>auth</replaceable> string
172        will be used for authentication.
173       </para></listitem>
174     </varlistentry>
175     <varlistentry><term>
176       <literal>-v</literal> <replaceable>level</replaceable>
177      </term><listitem>
178       <simpara>Sets the LOG level to <replaceable>level</replaceable>.
179        Level is a sequence of tokens separated by comma. Each token
180        is a integer or a named LOG item - one of 
181        <literal>fatal</literal>,
182        <literal>debug</literal>,
183        <literal>warn</literal>,
184        <literal>log</literal>,
185        <literal>malloc</literal>,
186        <literal>all</literal>,
187        <literal>none</literal>.
188       </simpara></listitem>
189     </varlistentry>
190     <varlistentry>
191      <term>-V</term>
192      <listitem><para>
193        Prints YAZ version.
194      </para></listitem>
195     </varlistentry>
196     <varlistentry>
197      <term>-x</term>
198      <listitem><para>
199        Makes the YAZ client print hex dumps of packages sent and received
200        on standard output.
201        </para></listitem>
202     </varlistentry>
203    </variablelist>
204   </refsect1>
205   <refsect1>
206    <title>COMMANDS</title>
207    <para>
208     The YAZ client accepts the following commands.
209    </para>
210    &yaz-client-commands;
211    </refsect1>
212  <refsect1><title>EXAMPLE</title>
213   <para>
214    The simplest example of a Prefix Query would be something like
215    <screen>
216     f knuth
217    </screen>
218    or
219    <screen>
220     f "donald knuth"
221    </screen>
222    In those queries no attributes was specified.
223    This leaves it up to the server what fields to search but
224    most servers will search in all fields. Some servers does not
225    support this feature though, and require that some attributes
226    are defined. To add one attribute you could do:
227    <screen>
228     f @attr 1=4 computer
229    </screen>
230    where we search in the title field, since the use(1) is title(4).
231    If we want to search in the author field <emphasis>and</emphasis>
232    in the title field, and in the title field using right truncation
233    it could look something like this:
234    <screen>
235     f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
236    </screen>
237    Finally using a mix of Bib-1 and GILS attributes could look
238    something like this:
239    <screen>
240     f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
241    </screen>
242   </para>
243  </refsect1>
244   <refsect1><title>FILES</title>
245    <para>
246     <filename>yaz-&lt;version&gt;/client/client.c</filename>
247    </para>
248    <para>
249     <filename>$HOME/.yazclientrc</filename>
250    </para>
251    <para>
252     <filename>$HOME/.yazclient.history</filename>
253    </para>
254   </refsect1>
255   <refsect1><title>SEE ALSO</title>
256    <para>
257     <citerefentry>
258      <refentrytitle>yaz</refentrytitle>
259      <manvolnum>7</manvolnum>
260     </citerefentry>
261     <citerefentry>
262      <refentrytitle>bib1-attr</refentrytitle>
263      <manvolnum>7</manvolnum>
264     </citerefentry>
265    </para>
266   </refsect1>
267 </refentry>
268
269 <!-- Keep this comment at the end of the file
270 Local variables:
271 mode: sgml
272 sgml-omittag:t
273 sgml-shorttag:t
274 sgml-minimize-attributes:nil
275 sgml-always-quote-attributes:t
276 sgml-indent-step:1
277 sgml-indent-data:t
278 sgml-parent-document:nil
279 sgml-local-catalogs: nil
280 sgml-namecase-general:t
281 End:
282 -->