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