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
typo
Alessandro Mauri 3 years ago
parent 21ca01e83d
commit ac778f6537
  1. 1
      rivet.1
  2. 15
      rivet.sh

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

@ -34,9 +34,10 @@ usage() {
printf "\t-h: prints this message\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-n [string]: Set the title of the atom feed"
printf "\t-d [string]: Set the description of the atom feed"
printf "\t-m [number]: Set the max number of elements in 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\n"
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-e: Do not prepend _header.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'
blog_title='Atom feed'
blog_desc=''
blog_nmax='3'
blog_nmax='0'
while getopts 'o:vhelfsrup:n:d:m:' c
do
case "$c" in
@ -244,8 +245,10 @@ EOF
count='0'
while IFS="" read -r line; do
count=$((count + 1))
if [ $count -gt "$blog_nmax" ]; then
break
if [ "$blog_nmax" -gt '0' ]; then
if [ $count -gt "$blog_nmax" ]; then
break
fi
fi
tfile="$(awk "NR==$count" "$objlist")"
title="$(sed -E -n 's/.*<title>\s*(.+)\s*<\/title>.*/\1/p' "$tfile")"

Loading…
Cancel
Save