summaryrefslogtreecommitdiff
path: root/quotaon.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2006-05-13 01:05:24 +0000
committerjkar8572 <jkar8572>2006-05-13 01:05:24 +0000
commit203e34e6a4bce09f7aa43f7f3ec64ee622c2e0ba (patch)
tree7c9dbf99505b616a7aa1b4ec35b8536b7429dcb4 /quotaon.c
parent6e8aa2396e0b2ef59f74cc97e109bbd14a395876 (diff)
downloadlinuxquota-203e34e6a4bce09f7aa43f7f3ec64ee622c2e0ba.tar.gz
Changed option parsing to use long options (Jan Kara)
Added option to always resolve even numeric names (Jan Kara) Corrected a few typos in manpaged (Jan Kara, Justin Pryzby)
Diffstat (limited to 'quotaon.c')
-rw-r--r--quotaon.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/quotaon.c b/quotaon.c
index 4062550..035c891 100644
--- a/quotaon.c
+++ b/quotaon.c
@@ -34,7 +34,7 @@
#ident "$Copyright: (c) 1980, 1990 Regents of the University of California $"
#ident "$Copyright: All rights reserved. $"
-#ident "$Id: quotaon.c,v 1.21 2005/11/21 22:30:23 jkar8572 Exp $"
+#ident "$Id: quotaon.c,v 1.22 2006/05/13 01:05:24 jkar8572 Exp $"
/*
* Turn quota on/off for a filesystem.
@@ -64,15 +64,39 @@ char *xarg = NULL;
static void usage(void)
{
- errstr(_("Usage:\n\t%s [-guvp] [-F quotaformat] [-x state] -a\n\t%s [-guvp] [-F quotaformat] [-x state] filesys ...\n"), progname, progname);
+ errstr(_("Usage:\n\t%s [-guvp] [-F quotaformat] [-x state] -a\n\
+\t%s [-guvp] [-F quotaformat] [-x state] filesys ...\n\n\
+-a, --all turn quotas on for all filesystems\n\
+-f, --off turn quotas off\n\
+-u, --user operate on user quotas\n\
+-g, --group operate on group quotas\n\
+-p, --print-state print whether quotas are on or off\n\
+-x, --xfs-command=cmd perform XFS quota command\n\
+-F, --format=formatname operate on specific quota format\n\
+-v, --verbose print more messages\n\
+-h, --help display this help text and exit\n\
+-V, --version display version information and exit\n"), progname, progname);
exit(1);
}
static void parse_options(int argcnt, char **argstr)
{
int c;
-
- while ((c = getopt(argcnt, argstr, "afvugpx:VF:")) != -1) {
+ struct option long_opts[] = {
+ { "all", 0, NULL, 'a' },
+ { "off", 0, NULL, 'f' },
+ { "verbose", 0, NULL, 'v' },
+ { "user", 0, NULL, 'u' },
+ { "group", 0, NULL, 'g' },
+ { "print-state", 0, NULL, 'p' },
+ { "xfs-command", 1, NULL, 'x' },
+ { "format", 1, NULL, 'F' },
+ { "version", 0, NULL, 'V' },
+ { "help", 0, NULL, 'h' },
+ { NULL, 0, NULL, 0 }
+ };
+
+ while ((c = getopt_long(argcnt, argstr, "afvugpx:VF:h", long_opts, NULL)) != -1) {
switch (c) {
case 'a':
flags |= FL_ALL;
@@ -102,6 +126,7 @@ static void parse_options(int argcnt, char **argstr)
case 'V':
version();
exit(0);
+ case 'h':
default:
usage();
}