diff --git a/clikan.sh b/clikan.sh index f33f6eb..efba6a0 100755 --- a/clikan.sh +++ b/clikan.sh @@ -1,6 +1,6 @@ #!/bin/sh # clikan.sh -- CLI Kanban -ver='2021-08-26/HB9KNS' +ver='2021-09-09/HB9KNS' conf="${CLIKANCONF:-$HOME/.clikanconf}" defkanban="$HOME/clikanban.md" @@ -363,8 +363,11 @@ p) echo "## planning for $planpart% of $tunits $planunit" fi # get estimated units for task, append '.0' to force decimal notation, # remove dot, keep one decimal and truncate additional figures -# (i.e multiply by 10) - tunits=`echo "$task" | sed -e "s/.*$tepatt.*/\2/;s/$/.0/;s/[.]\([0-9]\).*/\1/"` +# (i.e multiply by 10), remove leading 0s +# TODO: following 2 lines are really ugly, should be simplified... + tunits=`echo "$task" | sed -e "s/.*$tepatt.*/\2/;s/$/.0/;s/[.]\([0-9]\).*/\1/;s/^0*//"` +# if empty, set to 0 + tunits=${tunits:-0} # assign 2*weight/8*tunits/days per task, but not more than estimated units tcap=$(( $w8/4*$tunits/$td )) if test $tcap -gt $tunits