From: Dave Reisner <d@falconindy.com>
To: util-linux@vger.kernel.org
Cc: Dave Reisner <dreisner@archlinux.org>
Subject: [PATCH 2/2] findmnt: support alternative location of fstab
Date: Sun, 11 Dec 2011 13:58:05 -0500 [thread overview]
Message-ID: <1323629885-17940-3-git-send-email-dreisner@archlinux.org> (raw)
In-Reply-To: <1323629885-17940-1-git-send-email-dreisner@archlinux.org>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
misc-utils/findmnt.8 | 6 ++++--
misc-utils/findmnt.c | 6 +++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/misc-utils/findmnt.8 b/misc-utils/findmnt.8
index 24e3a52..7f3dc6c 100644
--- a/misc-utils/findmnt.8
+++ b/misc-utils/findmnt.8
@@ -36,12 +36,14 @@ The command prints all mounted filesystems in the tree-like format by default.
.SH OPTIONS
.IP "\fB\-h, \-\-help\fP"
Print help and exit.
-.IP "\fB\-s, \-\-fstab\fP"
+.IP "\fB\-s, \-\-fstab\fR[\fI=fstab\fR]\fP"
Search in
.IR /etc/fstab
and
.IR /etc/fstab.d .
-The output is in the list format (see --list).
+The output is in the list format (see --list). Optionally, search the file
+specified by
+.IR fstab .
.IP "\fB\-m, \-\-mtab\fP"
Search in
.IR /etc/mtab .
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 4577dc6..a23a432 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -770,7 +770,7 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
fprintf(out, _(
"\nOptions:\n"
- " -s, --fstab search in static table of filesystems\n"
+ " -s, --fstab[=<fstab>] search in static table of filesystems\n"
" -m, --mtab search in table of mounted filesystems\n"
" -k, --kernel search in kernel table of mounted\n"
" filesystems (default)\n\n"));
@@ -839,7 +839,7 @@ int main(int argc, char *argv[])
{ "direction", 1, 0, 'd' },
{ "evaluate", 0, 0, 'e' },
{ "first-only", 0, 0, 'f' },
- { "fstab", 0, 0, 's' },
+ { "fstab", 2, 0, 's' },
{ "help", 0, 0, 'h' },
{ "invert", 0, 0, 'i' },
{ "kernel", 0, 0, 'k' },
@@ -938,7 +938,7 @@ int main(int argc, char *argv[])
case 's': /* fstab */
if (tabfile)
errx_mutually_exclusive("--{fstab,mtab,kernel}");
- tabfile = _PATH_MNTTAB;
+ tabfile = optarg ? optarg : _PATH_MNTTAB;
tt_flags &= ~TT_FL_TREE;
break;
case 'k': /* kernel (mountinfo) */
--
1.7.8
next prev parent reply other threads:[~2011-12-11 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-11 18:58 [PATCH 0/2] Add user-defined fstab location for findmnt Dave Reisner
2011-12-11 18:58 ` [PATCH 1/2] findmnt: use warnx for libmnt error callback Dave Reisner
2011-12-16 10:43 ` Karel Zak
2011-12-11 18:58 ` Dave Reisner [this message]
2011-12-16 10:48 ` [PATCH 2/2] findmnt: support alternative location of fstab Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323629885-17940-3-git-send-email-dreisner@archlinux.org \
--to=d@falconindy.com \
--cc=dreisner@archlinux.org \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).