summaryrefslogtreecommitdiff
path: root/edquota.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2001-12-14 08:17:02 +0000
committerjkar8572 <jkar8572>2001-12-14 08:17:02 +0000
commita5f43989fc6842797487bfb8f3e61258ade22123 (patch)
tree6dd94232684bb145216af0914eb6120e1db08c1e /edquota.c
parent20fd773d48a98f9595608d91f8693adfa2176f21 (diff)
downloadlinuxquota-a5f43989fc6842797487bfb8f3e61258ade22123.tar.gz
Added -f <filesystem> option to edquota.
Diffstat (limited to 'edquota.c')
-rw-r--r--edquota.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/edquota.c b/edquota.c
index cd7f5b6..5f44905 100644
--- a/edquota.c
+++ b/edquota.c
@@ -34,7 +34,7 @@
#ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $"
#ident "$Copyright: All rights reserved. $"
-#ident "$Id: edquota.c,v 1.6 2001/08/15 20:13:42 jkar8572 Exp $"
+#ident "$Id: edquota.c,v 1.7 2001/12/14 08:17:02 jkar8572 Exp $"
/*
* Disk quota editor.
@@ -59,19 +59,20 @@
#include "common.h"
char *progname;
+char *dirname;
void usage(void)
{
#if defined(RPC_SETQUOTA)
- errstr("%s%s%s%s",
- _("Usage:\tedquota [-r] [-u] [-F formatname] [-p username] username ...\n"),
- _("\tedquota [-r] -g [-F formatname] [-p groupname] groupname ...\n"),
- _("\tedquota [-r] [-u] [-F formatname] -t\n"), _("\tedquota [-r] -g [-F formatname] -t\n"));
+ errstr("%s%s%s",
+ _("Usage:\tedquota [-r] [-u] [-F formatname] [-p username] [-f filesystem] username ...\n"),
+ _("\tedquota [-r] -g [-F formatname] [-p groupname] [-f filesystem] groupname ...\n"),
+ _("\tedquota [-r] [-u|g] [-F formatname] [-f filesystem] -t\n"));
#else
- errstr("%s%s%s%s",
- _("Usage:\tedquota [-u] [-F formatname] [-p username] username ...\n"),
- _("\tedquota -g [-F formatname] [-p groupname] groupname ...\n"),
- _("\tedquota [-u] [-F formatname] -t\n"), _("\tedquota -g [-F formatname] -t\n"));
+ errstr("%s%s%s",
+ _("Usage:\tedquota [-u] [-F formatname] [-p username] [-f filesystem] username ...\n"),
+ _("\tedquota -g [-F formatname] [-p groupname] [-f filesystem] groupname ...\n"),
+ _("\tedquota [-u|g] [-F formatname] [-f filesystem] -t\n"));
#endif
fprintf(stderr, _("Bugs to: %s\n"), MY_EMAIL);
exit(1);
@@ -93,11 +94,12 @@ int main(int argc, char **argv)
if (argc < 2)
usage();
+ dirname = NULL;
quotatype = USRQUOTA;
#if defined(RPC_SETQUOTA)
- while ((ret = getopt(argc, argv, "ugrntVp:F:")) != -1) {
+ while ((ret = getopt(argc, argv, "ugrntVp:F:f:")) != -1) {
#else
- while ((ret = getopt(argc, argv, "ugtVp:F:")) != -1) {
+ while ((ret = getopt(argc, argv, "ugtVp:F:f:")) != -1) {
#endif
switch (ret) {
case 'p':
@@ -123,6 +125,9 @@ int main(int argc, char **argv)
if ((fmt = name2fmt(optarg)) == QF_ERROR) /* Error? */
exit(1);
break;
+ case 'f':
+ dirname = optarg;
+ break;
case 'V':
version();
exit(0);
@@ -136,7 +141,7 @@ int main(int argc, char **argv)
if (tflag && argc != 0)
usage();
- handles = create_handle_list(0, NULL, quotatype, fmt, rflag ? 0 : IOI_LOCALONLY);
+ handles = create_handle_list(0, dirname ? &dirname : NULL, quotatype, fmt, rflag ? 0 : IOI_LOCALONLY);
if (!handles[0]) {
dispose_handle_list(handles);
fputs(_("No filesystems with quota detected.\n"), stderr);