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