|
@@ -5,7 +5,7 @@ LIBRARYDIRECTORY=~/.library
|
|
|
GIT=true
|
|
|
|
|
|
if [[ $# -eq 0 ]] ; then
|
|
|
- echo "library [ help | query query-expressions | add | emacs | git [ other-args ] | bulk-add number | report [ name | list | new name ] ]"
|
|
|
+ echo "library [ help | query query-expressions | add | emacs | git [ other-args ] | bulk-add number | report [ name | list | new name ] | edit id field ]"
|
|
|
exit
|
|
|
fi
|
|
|
|
|
@@ -107,6 +107,25 @@ bulk-add: Add a specified number of records.
|
|
|
EOF
|
|
|
}
|
|
|
|
|
|
+function do-edit {
|
|
|
+ ID=$1
|
|
|
+ shift
|
|
|
+ FIELD=$1
|
|
|
+ shift
|
|
|
+
|
|
|
+ if [[ $FIELD = "Withdrawn" ]] ; then
|
|
|
+ recins -e "ID = ${ID}" \
|
|
|
+ -f "Withdrawn" -v `date "%a, %d %b %Y %H:%M:%S %z"` \
|
|
|
+ ${LIBRARYFILE}
|
|
|
+ else
|
|
|
+ VALUE=$1
|
|
|
+ shift
|
|
|
+ recins -e "ID = ${ID}" \
|
|
|
+ -f "${FIELD}" -v "${VALUE}" \
|
|
|
+ ${LIBRARYFILE}
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
COMMAND=$1
|
|
|
shift
|
|
|
|
|
@@ -139,6 +158,10 @@ case ${COMMAND} in
|
|
|
emacsclient --alternate-editor="" -n ${LIBRARYFILE}
|
|
|
exit
|
|
|
;;
|
|
|
+ edit)
|
|
|
+ do-edit $@
|
|
|
+ exit
|
|
|
+ ;;
|
|
|
*)
|
|
|
display-help
|
|
|
exit
|