summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-03 14:02:15 +0000
committerRoy Marples <roy@marples.name>2007-09-03 14:02:15 +0000
commit52f7df0d0c36be3d92c67f46a0f9433b0150ccf4 (patch)
tree2530c6db89be6741140cbde3ad62617f066c4df4 /src
parenta16695853725ea55b68732071f1d2d54c4ef51cf (diff)
downloadopenrc-52f7df0d0c36be3d92c67f46a0f9433b0150ccf4.tar.gz
openrc-52f7df0d0c36be3d92c67f46a0f9433b0150ccf4.tar.bz2
openrc-52f7df0d0c36be3d92c67f46a0f9433b0150ccf4.tar.xz
Add --quiet to mountinfo
Diffstat (limited to 'src')
-rw-r--r--src/mountinfo.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mountinfo.c b/src/mountinfo.c
index 0461ee1..2c317f3 100644
--- a/src/mountinfo.c
+++ b/src/mountinfo.c
@@ -159,7 +159,7 @@ static regex_t *get_regex (char *string)
}
#include "_usage.h"
-#define getoptstring "f:F:n:N:p:P:os" getoptstring_COMMON
+#define getoptstring "f:F:n:N:op:P:qs" getoptstring_COMMON
static struct option longopts[] = {
{ "fstype-regex", 1, NULL, 'f'},
{ "skip-fstype-regex", 1, NULL, 'F'},
@@ -169,6 +169,7 @@ static struct option longopts[] = {
{ "skip-point-regex", 1, NULL, 'P'},
{ "node", 0, NULL, 'o'},
{ "fstype", 0, NULL, 's'},
+ { "quiet", 0, NULL, 'q'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
@@ -189,6 +190,7 @@ int mountinfo (int argc, char **argv)
bool fstype = false;
char **mounts = NULL;
int opt;
+ bool quiet = false;
int result;
#define DO_REG(_var) \
@@ -211,15 +213,18 @@ int mountinfo (int argc, char **argv)
case 'N':
DO_REG (skip_node_regex);
break;
+ case 'o':
+ node = true;
+ fstype = false;
+ break;
case 'p':
DO_REG (point_regex);
break;
case 'P':
DO_REG (skip_point_regex);
break;
- case 'o':
- node = true;
- fstype = false;
+ case 'q':
+ quiet = true;
break;
case 's':
node = false;
@@ -257,7 +262,8 @@ int mountinfo (int argc, char **argv)
continue;
if (skip_point_regex && regexec (skip_point_regex, n, 0, NULL, 0) == 0)
continue;
- printf ("%s\n", n);
+ if (! quiet)
+ printf ("%s\n", n);
result = EXIT_SUCCESS;
}
rc_strlist_free (nodes);