-
Notifications
You must be signed in to change notification settings - Fork 3
/
archnews.1
172 lines (131 loc) · 5.54 KB
/
archnews.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
.\" Process this file with
.\" groff -man -Tascii foo.1
.\" man 7 groff_mdoc Best resource ever
.\" man -l archnews.1 View preview
.\"
.TH ARCHNEWS 1 "MAY 2017" "archnews" "Archnews manual"
.SH NAME
archnews \- utility for displaying Arch RSS news feed in console
.SH SYNOPSIS
.B archnews
[options]
.SH DESCRIPTION
.B archnews
displays Arch news RSS feed in console. News description is formatted and line-wrapped,
time of publishing is converted into current timezone and displayed according locale.
Utility also offers additional filtering functionality like filtering news according
content and time or showing only unread news.
.SH OPTIONS
.IP "\fB\-h\fR, \fB\-\-help\fR"
Display help.
.IP "\fB\-w\fR WRAP_SIZE, \fB\-\-wrap\fR WRAP_SIZE"
Set wrap length (in number of characters), zero for no wrap. Default is 100.
.IP "\fB\-c\fR, \fB\-\-color\fR"
Turn off color output.
.IP "\fB\-b\fR, \fB\-\-brief-mode\fR"
Brief output: do not print body of each news.
.IP "\fB\-i\fR, \fB\-\-stdin\fR"
Read feed from stdin, do not fetch data from the Internet.
.IP "\fB\-l\fR, \fB\-\-locale\fR"
Locale to use (e.g. "cs_CZ.UTF-8"), it overrides environmental variable.
.IP "\fB\-r\fR, \fB\-\-reversed\fR"
Print newest news first. By default newest news are last.
.IP "\fB\-s\fR SINCE, \fB\-\-since\fR SINCE"
Show only news newer than given date. \fBSINCE\fR can be integer or date:
.RS
.RS
.IP integer
News newer than given number of days (0 for today, 1 for yesterday, etc.)
.IP "date in format YYYY-mm-dd"
News newer than given date (inclusively).
.RE
.sp
This option is a filter, see section FILTERS for more details.
.RE
.IP "\fB\-g\fR GREP, \fB\-\-grep\fR GREP"
Show only news that contains given string in title or description. Search is
case-insensitive. Search will be also highlighted in console output.
This option is a filter, see section FILTERS for more details.
.IP "\fB\-n\fR NUM_NEWS, \fB\-\-num\-news\fR NUM_NEWS"
How many news to show, zero or negative for all in feed. It worth to notice
RSS feed contains last 10 news, so numbers higher than 10 will not produce more.
Default number is 3 if no other filter is set, otherwise 0.
This option is a filter, see section FILTERS for more details.
.IP "\fB\-u\fR, \fB\-\-unread\fR"
Display only previously unread news.
.IP "\fB\-\-yes\fR"
Can be used only when \fB\-\-unread\fR is set. It marks news as read without asking.
It is mutually exclusive with \fB\-\-no\fR.
.IP "\fB\-\-no\fR"
Can be used only when \fB\-\-unread\fR is set. No news will be marked as read.
It is mutually exclusive with \fB\-\-yes\fR.
.IP "\fB\-\-version\fR"
Print version and quit.
.SH FILTERS
.IX Header "FILTERS"
Options \fB\-\-since\fR, \fB\-\-grep\fR and \fB\-\-num-news\fR
are filters. It means they can filter news according certain criterion. These filters
can be combined (e.g. use \fB\-\-grep\fR together with \fB\-\-num-news\fR),
but \fB\-\-num-news\fR will be always applied as the last filter.
.SH FILES
.IX Header "FILES"
.IP "\fIhttps://www.archlinux.org/feeds/news/\fR"
.IX Item "https://www.archlinux.org/feeds/news/"
URL of the source RSS feed.
.IP "\fI$XDG_DATA_HOME/archnews/unread\fR"
.IX Item "$XDG_DATA_HOME/archnews/unread"
File stores date of the last news marked as read. This file is created and updated
only when option \fB\-\-unread\fR is used. If no \fB$XDG_DATA_HOME\fR is set, then
\fI'~/.local/share/\fR is used.
.IP "\fI$HOME/.config/archnews_wrap_conf.sh\fR"
.IX Item "$HOME/.config/archnews_wrap_conf.sh"
This file is sourced at the beginning of \fBarchnews_wrap\fR script. It
might contain definition of \fB$ARCHNEWS_PACKAGE_MANAGER_FULL_PATH\fR
(see ENVIRONMENT section for details).
(E.g. file might contain line like this:
\fBARCHNEWS_PACKAGE_MANAGER_FULL_PATH=/usr/bin/pacaur\fR)
Beware that \fBarchnews_wrap\fR is usually run as root, so the config must be
in root's home, not in regular user's!
.SH ENVIRONMENT
.IP \fBLOCALE\fR
From locale is read settings for displaying date and time. (It can be overridden
by \fB--locale\fR parameter.)
.IP "\fB$XDG_DATA_HOME\fR"
Path to home data directory, see FILES section for details.
.IP "\fB$ARCHNEWS_PARAMS\fR"
Command line arguments which are passed to \fBarchnews\fR automatically.
.IP "\fB$ARCHNEWS_PACKAGE_MANAGER_FULL_PATH\fR"
Variable might contain FULL path to "pacman compatible" tool \fBarchnews_wrap\fR
will use as its backend. Be default it is \fI/usr/bin/pacman\fR. It can be set
directly (but remember: sudo changes environment!) or in \fBarchnews_wrap\fR
configuration script (see FILES section).
.SH RETURN CODES
.IP \fB0\fR
Everything went well and some news were shown.
.IP \fB1\fR
Everything went well but no news were shown.
.IP \fB2\fR
Error in parameters.
.IP \fB3\fR
Runtime error occured, e.g. feed cannot be fetched.
.SH PACMAN WRAPPER
\fBarchnews\fR comes with a wrapper for \fBpacman\fR called
\fBarchnews_wrap\fR, that runs \fBarchnews\fR when upgrading the system
(\fBpacman -Syu\fR). The wrapper runs \fBarchnews\fR script with
\fB--unread\fR option, so one will never miss a news when doing dist-upgrade!
All what is needed to do is to have these two aliases:
.RS
.nf
\fBalias sudo='sudo '\fR # This enables aliases for commands inside sudo.
\fBalias pacman=archnews_wrap\fR # This invokes wrapper whenever pacman is called.
.fi
.RE
The first invocation will list all news in feed. Further invocations will
display only unread messages. (Of course info about unread messages is stored
inside user's home directory, it is not system-wide!)
.SH BUGS
Probably some. Would be great if you report them!
.SH AUTHOR
Martin Jiřička <mjiricka at gmail dot com>
.SH "SEE ALSO"
.BR pacman (8)