Browse Source

Updated Library Add functionality

Samuel W. Flint 7 years ago
parent
commit
b9ee26c31d
1 changed files with 18 additions and 1 deletions
  1. 18 1
      library.org

+ 18 - 1
library.org

@@ -188,6 +188,7 @@ This handles git as needed, by first checking to see if the first argument is ~i
 #+Name: add-book
 #+BEGIN_SRC sh
   function add-single {
+      if [[ $# -lt 7]] ; then
       echo -n "Title: "
       read TITLE
       echo -n "Author: "
@@ -202,6 +203,22 @@ This handles git as needed, by first checking to see if the first argument is ~i
       read ISBN
       echo -n "Location: "
       read LOCATION
+      else
+          TITLE=$1
+          shift
+          AUTHOR=$1
+          shift
+          LCCN=$1
+          shift
+          COPYRIGHT=$1
+          shift
+          PUBLISHER=$1
+          shift
+          ISBN=$1
+          shift
+          LOCATION=$1
+          shift
+      fi
       recins -t Book \
              -f Title -v "${TITLE}" \
              -f Author -v "${AUTHOR}" \
@@ -438,7 +455,7 @@ This handles git as needed, by first checking to see if the first argument is ~i
           exit
           ;;
       add)
-          add-single
+          add-single $@
           exit
           ;;
       git)