Add a '-b' option, to print the article number bounds of a newsgroup.
[sgt/utils] / nntpid / nntpid.but
CommitLineData
3096ed75 1\cfg{man-identity}{nntpid}{1}{2004-11-21}{Simon Tatham}{Simon Tatham}
2
3\title Man page for \cw{nntpid}
4
5\U NAME
6
7\cw{nntpid} - retrieve a single article from a news server
8
9\U SYNOPSIS
10
67784f1f 11\c nntpid [ -v ] [ -d ] article [ article... ]
12\e bbbbbb bb bb iiiiiii iiiiiii
13\c nntpid [ -v ] [ -d ]
14\e bbbbbb bb bb
52f9a468 15\c nntpid [ -v ] -a newsgroup-name
16\e bbbbbb bb bb iiiiiiiiiiiiii
3096ed75 17
18\U DESCRIPTION
19
52f9a468 20\cw{nntpid} makes a connection to a news server, retrieves one or
67784f1f 21more articles, and displays them.
3096ed75 22
23You can specify the article you want by either:
24
25\b giving its Message-ID. Message-IDs are globally unique, so you
26don't need to know which newsgroup the article was in. Also, they do
27not vary between news servers.
28
29\b giving a newsgroup name and an article number within that
30newsgroup. Article numbers are assigned internally by a particular
31news server, so they will be different on other servers carrying the
32same group.
33
a5d9e758 34By default, \cw{nntpid} will try to display the article using a
35pager (\cw{more}(1), unless you have specified an alternative in the
36environment variable \cw{PAGER}). This is partly for convenience,
37and partly a mild security measure: it gives you some protection
38against the news article potentially containing control sequences
39that cause unexpected behaviour in your terminal. If \cw{nntpid}
40detects that its standard output is not a terminal, however, it will
41bypass the pager and just write out the article directly.
42
db8c4d39 43There are a couple of alternative mode of operation. In one, enabled
44by the \cw{-a} option, \cw{nntpid} retrieves \e{all} available
45articles in the group and writes them to standard output in \cw{mbox}
46format. In the other, enabled with \cw{-b}, \cw{nntpid} simply prints
47the lowest and highest article numbers currently available in that
48group from the news server.
52f9a468 49
016b40f7 50The location of the news server is obtained by reading the
51environment variable \cw{NNTPSERVER}, or failing that the file
52\cw{/etc/nntpserver}.
53
3096ed75 54\U ARGUMENTS
55
67784f1f 56\cw{nntpid} will attempt to interpret its argument list as specifying
57a series of news articles, as follows:
3096ed75 58
67784f1f 59\b An argument containing an @ sign will be parsed as a Message-ID.
60The angle brackets that usually delimit Message-IDs are optional;
61\cw{nntpid} will strip them off if it sees them, and will not complain
62if it does not. If the angle brackets are present, anything outside
63them will also be discarded.
64
65\b Otherwise, an argument containing whitespace or a colon will be
66parsed as a group name and an article number.
67
68\b Otherwise, two successive arguments will be treated as a group name
69and an article number.
70
71For example, the following invocations should all behave identically.
72(Single quotes are intended to represent POSIX shell quoting, not part
73of the command line as it reaches \cw{nntpid}.)
74
75\c $ nntpid '<foo.bar@baz.quux>' misc.test 1234
76\e bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
77\c $ nntpid 'foo.bar@baz.quux' misc.test:1234
78\e bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
79\c $ nntpid 'wibble <foo.bar@baz.quux> blah' 'misc.test 1234'
80\e bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
81
82If \cw{nntpid} is given no arguments at all, it will read from
83standard input. Every line it reads will be interpreted as described
84above, except that whitespace will also be trimmed from the start and
85end of the line first.
86
87If you provide the \cw{-a} option (see below), none of the above
88applies. Instead, \cw{nntpid} will expect exactly one command-line
89argument, which it will treat as a newsgroup name.
3096ed75 90
91\U OPTIONS
92
93\dt \cw{-v}
94
95\dd Verbose mode. In this mode, \cw{nntpid} will log its entire
96conversation with the news server on standard error.
97
a5d9e758 98\dt \cw{-d}
99
100\dd Direct output. In this mode, \cw{nntpid} will write the article
101straight to standard output without bothering to try using a pager.
102
52f9a468 103\dt \cw{-a}
104
105\dd Retrieve all articles from the given newsgroup. In this mode,
106\cw{nntpid} will always write straight to standard output (so the
107\cw{-d} option is unnecessary).
108
db8c4d39 109\dt \cw{-b}
110
111\dd Print the current bounds on that group's article numbers. The
112output is one line consisting of a minimum and maximum article number.
113(Not every article in that range will necessarily actually exist: a
114cancelled article will still use up a space in the numbering range.)
115
0f90ca06 116\U AUTHENTICATION
117
118Currently, the only form of authentication supported by \cw{nntpid}
119is \cw{AUTHINFO GENERIC}, using the environment variable
120\cw{NNTPAUTH}. It will only attempt this if it receives a 480
121response from the news server; if your news server never sends 480
122then \cw{nntpid} will never even look at \cw{NNTPAUTH}.
123
3096ed75 124\U LICENCE
125
126\cw{nntpid} is free software, distributed under the MIT licence.
127Type \cw{nntpid --licence} to see the full licence text.
128
129\versionid $Id$