mirror of git://git.suckless.org/ubase
Implement the -q option for mountpoint(1)
This commit is contained in:
parent
9827789a47
commit
a81264cda1
10
mountpoint.c
10
mountpoint.c
|
@ -8,18 +8,22 @@
|
|||
static void
|
||||
usage(void)
|
||||
{
|
||||
eprintf("usage: %s target\n", argv0);
|
||||
eprintf("usage: %s [-q] target\n", argv0);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
int qflag = 0;
|
||||
struct mntinfo *minfo = NULL;
|
||||
int siz;
|
||||
int ret = 0;
|
||||
|
||||
ARGBEGIN {
|
||||
case 'q':
|
||||
qflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
} ARGEND;
|
||||
|
@ -38,5 +42,9 @@ main(int argc, char *argv[])
|
|||
if (i == siz)
|
||||
ret = 1;
|
||||
|
||||
if (!qflag)
|
||||
printf("%s %s a mountpoint\n", argv[0],
|
||||
!ret ? "is" : "is not");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue