|
@@ -6,13 +6,13 @@ GIT=detect
|
|
|
|
|
|
# help-message, /home/swflint/org/library.org
|
|
# help-message, /home/swflint/org/library.org
|
|
if [[ $# -eq 0 ]] ; then
|
|
if [[ $# -eq 0 ]] ; then
|
|
- echo "library [ help | query | add | git | bulk-add | report | edit | loan | do-return | init ]"
|
|
|
|
|
|
+ echo "library [ help | query | add | git | bulk-add | report | edit | loan | return-book | init ]"
|
|
exit
|
|
exit
|
|
fi
|
|
fi
|
|
|
|
|
|
function display-help {
|
|
function display-help {
|
|
cat <<EOF
|
|
cat <<EOF
|
|
-library [ help | query | add | git | bulk-add | report | edit | loan | do-return | init ]
|
|
|
|
|
|
+library [ help | query | add | git | bulk-add | report | edit | loan | return-book | init ]
|
|
|
|
|
|
help: Display this help message.
|
|
help: Display this help message.
|
|
query: Query Library Database.
|
|
query: Query Library Database.
|
|
@@ -22,7 +22,7 @@ bulk-add: Add a specified number of records.
|
|
report: Run a report.
|
|
report: Run a report.
|
|
edit: Edit the value of a specified field in a specified record.
|
|
edit: Edit the value of a specified field in a specified record.
|
|
loan: Loan a book out.
|
|
loan: Loan a book out.
|
|
-do-return: Process a book return
|
|
|
|
|
|
+return-book:Process a book return
|
|
init: Initialize the database.
|
|
init: Initialize the database.
|
|
EOF
|
|
EOF
|
|
}
|
|
}
|
|
@@ -93,20 +93,20 @@ function run-query {
|
|
# add-book, /home/swflint/org/library.org
|
|
# add-book, /home/swflint/org/library.org
|
|
function add-single {
|
|
function add-single {
|
|
if [[ $# -lt 7 ]] ; then
|
|
if [[ $# -lt 7 ]] ; then
|
|
- echo -n "Title: "
|
|
|
|
- read TITLE
|
|
|
|
- echo -n "Author: "
|
|
|
|
- read AUTHOR
|
|
|
|
- echo -n "LCCN: "
|
|
|
|
- read LCCN
|
|
|
|
- echo -n "Copyright: "
|
|
|
|
- read COPYRIGHT
|
|
|
|
- echo -n "Publisher: "
|
|
|
|
- read PUBLISHER
|
|
|
|
- echo -n "ISBN: "
|
|
|
|
- read ISBN
|
|
|
|
- echo -n "Location: "
|
|
|
|
- read LOCATION
|
|
|
|
|
|
+ echo -n "Title: "
|
|
|
|
+ read TITLE
|
|
|
|
+ echo -n "Author: "
|
|
|
|
+ read AUTHOR
|
|
|
|
+ echo -n "LCCN: "
|
|
|
|
+ read LCCN
|
|
|
|
+ echo -n "Copyright: "
|
|
|
|
+ read COPYRIGHT
|
|
|
|
+ echo -n "Publisher: "
|
|
|
|
+ read PUBLISHER
|
|
|
|
+ echo -n "ISBN: "
|
|
|
|
+ read ISBN
|
|
|
|
+ echo -n "Location: "
|
|
|
|
+ read LOCATION
|
|
else
|
|
else
|
|
TITLE=$1
|
|
TITLE=$1
|
|
shift
|
|
shift
|