option to include everything in atom feed

Fixed missing newlines in help message and made it so that setting the -m flag
to 0 incudes all files in the atom feed. Also madde this behaviur the default
pull/1/head
Alessandro Mauri 4 years ago
parent 21ca01e83d
commit ac778f6537
  1. 1
      rivet.1
  2. 11
      rivet.sh

@ -51,6 +51,7 @@ Set the description of the atom feed to
.IP "\-n number" .IP "\-n number"
Set the maximum number of elements in the atom feed to Set the maximum number of elements in the atom feed to
.I number .I number
setting it to '0' includes all files
.IP \-v .IP \-v
verbose option, sets -x and prints every command as it runs verbose option, sets -x and prints every command as it runs
.IP \-h .IP \-h

@ -34,9 +34,10 @@ usage() {
printf "\t-h: prints this message\n" printf "\t-h: prints this message\n"
printf "\t-o [destdir]: specifies the output direcotory to be [destdir]\n" printf "\t-o [destdir]: specifies the output direcotory to be [destdir]\n"
printf "\t-p [string]: Rename the \"Pages\" section to [string]\n" printf "\t-p [string]: Rename the \"Pages\" section to [string]\n"
printf "\t-n [string]: Set the title of the atom feed" printf "\t-n [string]: Set the title of the atom feed\n"
printf "\t-d [string]: Set the description of the atom feed" printf "\t-d [string]: Set the description of the atom feed\n"
printf "\t-m [number]: Set the max number of elements in the atom feed" printf "\t-m [number]: Set the max number of elements in the atom feed,
0 to include all files\n"
printf "\t-v: Makes the script verbose\n" printf "\t-v: Makes the script verbose\n"
printf "\t-e: Do not prepend _header.html to .html files\n" printf "\t-e: Do not prepend _header.html to .html files\n"
printf "\t-f: Do not prepend _footer.html to .html files\n" printf "\t-f: Do not prepend _footer.html to .html files\n"
@ -71,7 +72,7 @@ prefix='https'
linksec='Pages' linksec='Pages'
blog_title='Atom feed' blog_title='Atom feed'
blog_desc='' blog_desc=''
blog_nmax='3' blog_nmax='0'
while getopts 'o:vhelfsrup:n:d:m:' c while getopts 'o:vhelfsrup:n:d:m:' c
do do
case "$c" in case "$c" in
@ -244,9 +245,11 @@ EOF
count='0' count='0'
while IFS="" read -r line; do while IFS="" read -r line; do
count=$((count + 1)) count=$((count + 1))
if [ "$blog_nmax" -gt '0' ]; then
if [ $count -gt "$blog_nmax" ]; then if [ $count -gt "$blog_nmax" ]; then
break break
fi fi
fi
tfile="$(awk "NR==$count" "$objlist")" tfile="$(awk "NR==$count" "$objlist")"
title="$(sed -E -n 's/.*<title>\s*(.+)\s*<\/title>.*/\1/p' "$tfile")" title="$(sed -E -n 's/.*<title>\s*(.+)\s*<\/title>.*/\1/p' "$tfile")"
if [ -z "$title" ]; then if [ -z "$title" ]; then

Loading…
Cancel
Save