summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog2
-rw-r--r--doc/quotadoc.sgml7
-rw-r--r--quota.112
-rw-r--r--quota.c20
4 files changed, 26 insertions, 15 deletions
diff --git a/Changelog b/Changelog
index 795bb28..37b22c7 100644
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,7 @@
Changes in quota-tools from 3.13 to 3.14
* implemented nicer message formatting for warnquota(8) (Jan Kara)
+* quota(1) has -w option to supress line wrapping for long device names (Jan Kara)
+* quota(1) prints grace time even if hard limit is reached (Jan Kara)
Changes in quota-tools from 3.12 to 3.13
* fixed mistakes in several error messages, improved error reporting functions
diff --git a/doc/quotadoc.sgml b/doc/quotadoc.sgml
index 14ffc28..ff724bd 100644
--- a/doc/quotadoc.sgml
+++ b/doc/quotadoc.sgml
@@ -67,10 +67,9 @@ file with quota information) and <tt/filename/ must specify a file in the root
directory of a filesystem. When any of <tt/jquota/ options is specified
additional option <tt/jqfmt=format/ must be also specified where <tt/format/ is
a format of quota files. As journaled quota is currently supported only for
-<tt/vfsv0/ format the value of format must be <tt/vfsv0/. Note also that
-journaled quota is currently (as of March 2004) supported only for Ext3
-filesystem and you need to have a kernel patched with a special patch
-(contained for example in -mm series of a kernel).
+<tt/vfsv0/ format the value of format must be <tt/vfsv0/. Journaled quota
+is currently (as of July 2005) supported for Ext3 and Reiserfs filesystems
+and you need to have at least 2.6.11 kernel.
<p>
For each filesystem with quotas you have to have files with quota data. The
name of these quota files depends on <ref id="quota_formats" name="quota
diff --git a/quota.1 b/quota.1
index 040650a..789b909 100644
--- a/quota.1
+++ b/quota.1
@@ -7,7 +7,7 @@ quota \- display disk usage and limits
.B -F
.I format-name
] [
-.BR -guvsil \ |
+.BR -guvsilw \ |
.B q
]
.br
@@ -16,7 +16,7 @@ quota \- display disk usage and limits
.B -F
.I format-name
] [
-.BR -uvsil \ |
+.BR -uvsilw \ |
.B q
]
.IR user ...
@@ -26,7 +26,7 @@ quota \- display disk usage and limits
.B -F
.I format-name
] [
-.BR -gvsil \ |
+.BR -gvsilw \ |
.B q
]
.IR group ...
@@ -87,6 +87,12 @@ on filesystems where usage is over quota.
.B \-Q
Do not print error message if connection to rpc.rquotad is refused (usually this happens
when rpc.rquotad is not running on the server).
+.TP
+.B \-w
+Do not wrap the line if the device name is too long. This can be useful when parsing
+the output of
+.BR quota (1)
+by a script.
.LP
Specifying both
.B \-g
diff --git a/quota.c b/quota.c
index 1ee9ecb..2ac58e0 100644
--- a/quota.c
+++ b/quota.c
@@ -34,7 +34,7 @@
#ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $"
#ident "$Copyright: All rights reserved. $"
-#ident "$Id: quota.c,v 1.15 2004/04/20 19:33:05 jkar8572 Exp $"
+#ident "$Id: quota.c,v 1.16 2005/07/19 15:09:07 jkar8572 Exp $"
/*
* Disk quota reporting program.
@@ -68,6 +68,7 @@
#define FL_LOCALONLY 32
#define FL_QUIETREFUSE 64
#define FL_NOAUTOFS 128
+#define FL_NOWRAP 256
int flags, fmt = -1;
char *progname;
@@ -85,7 +86,7 @@ int main(int argc, char **argv)
gettexton();
progname = basename(argv[0]);
- while ((ret = getopt(argc, argv, "guqvsVliQF:")) != -1) {
+ while ((ret = getopt(argc, argv, "guqvsVliQF:w")) != -1) {
switch (ret) {
case 'g':
flags |= FL_GROUP;
@@ -115,6 +116,9 @@ int main(int argc, char **argv)
case 'i':
flags |= FL_NOAUTOFS;
break;
+ case 'w':
+ flags |= FL_NOWRAP;
+ break;
case 'V':
version();
exit(0);
@@ -166,9 +170,9 @@ int main(int argc, char **argv)
void usage(void)
{
errstr( "%s%s%s",
- _("Usage: quota [-guqvs] [-l | -Q] [-i] [-F quotaformat]\n"),
- _("\tquota [-qvs] [-l | -Q] [-i] [-F quotaformat] -u username ...\n"),
- _("\tquota [-qvs] [-l | -Q] [-i] [-F quotaformat] -g groupname ...\n"));
+ _("Usage: quota [-guqvsw] [-l | -Q] [-i] [-F quotaformat]\n"),
+ _("\tquota [-qvsw] [-l | -Q] [-i] [-F quotaformat] -u username ...\n"),
+ _("\tquota [-qvsw] [-l | -Q] [-i] [-F quotaformat] -g groupname ...\n"));
fprintf(stderr, _("Bugs to: %s\n"), MY_EMAIL);
exit(1);
}
@@ -240,7 +244,7 @@ int showquotas(int type, qid_t id)
if (!lines++)
heading(type, id, name, "");
- if (strlen(q->dq_h->qh_quotadev) > 15)
+ if (strlen(q->dq_h->qh_quotadev) > 15 && !(flags & FL_NOWRAP))
printf("%s\n%15s", q->dq_h->qh_quotadev, "");
else
printf("%15s", q->dq_h->qh_quotadev);
@@ -250,14 +254,14 @@ int showquotas(int type, qid_t id)
space2str(q->dq_dqb.dqb_bsoftlimit, numbuf[1], !!(flags & FL_SMARTSIZE));
space2str(q->dq_dqb.dqb_bhardlimit, numbuf[2], !!(flags & FL_SMARTSIZE));
printf(" %7s%c %6s %7s %7s", numbuf[0], bover ? '*' : ' ', numbuf[1],
- numbuf[2], bover > 1 ? timebuf : "");
+ numbuf[2], bover ? timebuf : "");
if (iover)
difftime2str(q->dq_dqb.dqb_itime, timebuf);
number2str(q->dq_dqb.dqb_curinodes, numbuf[0], !!(flags & FL_SMARTSIZE));
number2str(q->dq_dqb.dqb_isoftlimit, numbuf[1], !!(flags & FL_SMARTSIZE));
number2str(q->dq_dqb.dqb_ihardlimit, numbuf[2], !!(flags & FL_SMARTSIZE));
printf(" %7s%c %6s %7s %7s\n", numbuf[0], iover ? '*' : ' ', numbuf[1],
- numbuf[2], iover > 1 ? timebuf : "");
+ numbuf[2], iover ? timebuf : "");
continue;
}
}