]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm quota get: Print usage also in percentages.
authorTimo Sirainen <tss@iki.fi>
Wed, 2 Jun 2010 18:24:07 +0000 (19:24 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 2 Jun 2010 18:24:07 +0000 (19:24 +0100)
--HG--
branch : HEAD

src/plugins/quota/doveadm-quota.c

index 3de32e1388a8fc6d2a599ab23b335f9b0b229c60..0d5668502bba7a559a0112bf735536345eb68789 100644 (file)
@@ -28,6 +28,10 @@ static void cmd_quota_get_root(struct mail_user *user, struct quota_root *root)
                        printf("%llu/%llu",
                               (unsigned long long)value,
                               (unsigned long long)limit);
+                       if (limit != 0) {
+                               printf(" (%u%%)",
+                                      (unsigned int)(value*100/limit));
+                       }
                } else if (ret == 0) {
                        printf("%llu/unlimited",
                               (unsigned long long)value);