diff --git a/rivet.1 b/rivet.1 index 6bf4e7a..67c0a71 100644 --- a/rivet.1 +++ b/rivet.1 @@ -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 diff --git a/rivet.sh b/rivet.sh index 53ae010..d1dd9a3 100644 --- a/rivet.sh +++ b/rivet.sh @@ -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/.*