1
0
mirror of git://git.suckless.org/ubase synced 2024-12-22 06:40:38 +00:00

Implement the -q option for mountpoint(1)

This commit is contained in:
sin 2013-08-29 18:48:52 +01:00
parent 9827789a47
commit a81264cda1

View File

@ -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;
}