Ver Fonte

Updated the library management script

Samuel W. Flint há 8 anos atrás
pai
commit
c714669e88
1 ficheiros alterados com 14 adições e 10 exclusões
  1. 14 10
      library

+ 14 - 10
library

@@ -184,7 +184,7 @@ function do_edit {
 
 function do_edit_exp {
     if [[ $# -lt 3 ]] ; then
-        echo "ledger edit-matching match-exp field value"
+        echo "ledger edit-matching match-exp field value [ commit-message  ]"
         exit 1
     fi
     MATCHEXPRESSION=$1
@@ -197,7 +197,11 @@ function do_edit_exp {
            -f "${FIELDNAME}" -S "${VALUE}" \
            ${LIBRARYFILE}
     do_git add $(basename ${LIBRARYFILE})
-    do_git commit -m "Edited records"
+    if [[ $1 != "" ]] ; then
+        do_git commit -m "${1}"
+    else
+        do_git commit -m "Bulk edited records"
+    fi
 }
 # edit-field ends here
 
@@ -288,27 +292,27 @@ case ${COMMAND} in
         exit
         ;;
     query)
-        run_query $@
+        run_query "$@"
         exit
         ;;
     add)
-        add_single $@
+        add_single "$@"
         exit
         ;;
     git)
-        do_git $@
+        do_git "$@"
         exit
         ;;
     bulk-add)
-        bulk_add $@
+        bulk_add "$@"
         exit
         ;;
     report)
-        do_report $@
+        do_report "$@"
         exit
         ;;
     edit)
-        do_edit $@
+        do_edit "$@"
         exit
         ;;
     edit-matching)
@@ -316,11 +320,11 @@ case ${COMMAND} in
         exit
         ;;
     loan)
-         do_loan $@
+         do_loan "$@"
          exit
          ;;
     return-book)
-        do_return $@
+        do_return "$@"
         exit
         ;;
     init)