Fixed a problem with updatenext, and allowed shortcuts for the main options.
--- a/bug Tue Oct 24 20:39:28 2006 +0200
+++ b/bug Wed Oct 25 19:37:54 2006 +0200
@@ -119,10 +119,10 @@
function addfile
{
- ID=`grep "^Id:" $1 | head -n 1 | cut -d : -f 2 | string2db`
- SUBJECT=`grep "^Subject:" $1 | head -n 1 | cut -d : -f 2 | string2db`
- STATE=`grep "^State:" $1 | head -n 1 | cut -d : -f 2 | string2db`
- PRIORITY=`grep "^Priority:" $1 | head -n 1 | cut -d : -f 2 | string2db`
+ ID=`grep "^Id:" $1 | head -n 1 | cut -d : -f 2- | string2db`
+ SUBJECT=`grep "^Subject:" $1 | head -n 1 | cut -d : -f 2- | string2db`
+ STATE=`grep "^State:" $1 | head -n 1 | cut -d : -f 2- | string2db`
+ PRIORITY=`grep "^Priority:" $1 | head -n 1 | cut -d : -f 2- | string2db`
if ( [ "x$SUBJECT" == "" ] || [ "x$PRIORITY" == "" ] ); then
echo "Error in ticket: subject or priority." 2>&1
@@ -136,7 +136,15 @@
DESCRIPTION=`tail -n $TOTAIL $1 | text2db | trimlastdbNL`
echo "$ID $PRIORITY $STATE $SUBJECT $DESCRIPTION" >> $BUG_PROJECT
- updatenext $((ID + 1))
+
+ # Update the next ID number
+ NEXT=`getnext`
+ if [ $NEXT -gt $ID ]; then
+ updatenext $((NEXT + 1))
+ else
+ updatenext $((ID + 1))
+ fi
+
return 0
}
@@ -283,25 +291,25 @@
fi
case "$CMD" in
- add)
+ a*)
add || exit 1
;;
- list)
+ l*)
list || exit 1
;;
- view)
+ v*)
view $2 || exit 1
;;
- project)
+ p*)
echo Project: $BUG_PROJECT
;;
- delete)
+ del*)
delete $2 || exit 1
;;
create)
create || exit 1
;;
- edit)
+ e*)
edit $2 || exit 1
;;
*)