Merge pull request #28 from davinerd/feat_issue_1

we'll print a warning on 'list' if the tomb is almost full
This commit is contained in:
Jaromil 2011-08-19 06:31:16 -07:00
commit a73e0a3519

View File

@ -1034,7 +1034,7 @@ list_tombs() {
tombused=${ts[(ws:;:)2]} tombused=${ts[(ws:;:)2]}
tombavail=${ts[(ws:;:)3]} tombavail=${ts[(ws:;:)3]}
tombpercent=${ts[(ws:;:)4]} tombpercent=${ts[(ws:;:)4]}
tombp=${tombpercent%%%}
tombsince=`date --date=@${mapper[(ws:.:)3]} +%c` tombsince=`date --date=@${mapper[(ws:.:)3]} +%c`
# breaking up such strings is good for translation # breaking up such strings is good for translation
@ -1055,6 +1055,10 @@ list_tombs() {
print -n "$fg_bold[white]$tombpercent" print -n "$fg_bold[white]$tombpercent"
print "$fg_no_bold[white] full)" print "$fg_no_bold[white] full)"
if [[ ${tombp} -ge 90 ]]; then
error "Your tomb is almost full!"
fi
print -n "$fg_no_bold[green]$tombname" print -n "$fg_no_bold[green]$tombname"
print -n "$fg_no_bold[white] open since " print -n "$fg_no_bold[white] open since "
print "$fg_bold[white]$tombsince$fg_no_bold[white]" print "$fg_bold[white]$tombsince$fg_no_bold[white]"