aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2006-09-05 20:14:38 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2006-09-05 20:14:38 +0000
commit0ff13cd5eff8dcfd25b184a1e92d3362ec8f3c5b (patch)
tree0b4eb4c0a8196b03d45e58adfa1bbc3ee4b50cfc
parent7d6e018fd161bf44b9d0103f0537d81286963194 (diff)
downloadpaludis-0ff13cd5eff8dcfd25b184a1e92d3362ec8f3c5b.tar.gz
paludis-0ff13cd5eff8dcfd25b184a1e92d3362ec8f3c5b.tar.xz
Add an "all" option for the read and unread actions, to allow reading all news items, or marking all read items as unread.
-rw-r--r--eselect/news.eselect20
1 files changed, 18 insertions, 2 deletions
diff --git a/eselect/news.eselect b/eselect/news.eselect
index ca7dc36..903f9a5 100644
--- a/eselect/news.eselect
+++ b/eselect/news.eselect
@@ -143,7 +143,8 @@ describe_read_parameters() {
describe_read_options() {
echo "target : News item ID (from 'list' action), or the special" \
- "item 'new', to list all new news items."
+ "item 'new', to list all new news items, or 'all', to" \
+ "show all items"
}
do_read() {
@@ -157,6 +158,12 @@ do_read() {
do_read "${i%::*}"
done
return
+ elif [[ "${1}" == "all" ]] ; then
+ items=( "${items[@]}" $(get_read) )
+ for i in "${items[@]}" ; do
+ do_read "${i%::*}"
+ done
+ return
fi
for i in ${items[@]} ; do
@@ -202,7 +209,8 @@ describe_unread_parameters() {
}
describe_unread_options() {
- echo "target : News item ID (from 'list' action)"
+ echo "target : News item ID (from 'list' action), or the special" \
+ "item 'all', to mark all items as unread"
}
do_unread() {
@@ -210,6 +218,14 @@ do_unread() {
local i item= items
items=( $(get_read ) )
+
+ if [[ "${1}" == "all" ]] ; then
+ for i in "${items[@]}" ; do
+ do_unread "${i%::*}"
+ done
+ return
+ fi
+
for i in ${items[@]} ; do
[[ -n "${item}" ]] && break
[[ "${i%::*}" == "${1}" ]] || continue