~nabijaczleweli/voreutils

26cc8e71a5318f35e88fcb558003d92536a30fd6 — наб 2 months ago 38f01eb
Support df -F alias for -t
2 files changed, 19 insertions(+), 10 deletions(-)

M cmd/df.cpp
M man/df.1
M cmd/df.cpp => cmd/df.cpp +3 -2
@@ 39,7 39,7 @@


#define USAGE(self) \
	"usage: %s [-PklaiThH] [-t only-type]... [-x not-type]... [-B blocksize] [--output[=col[,col]...]] [--[no-]sync] [--total] [path|device]...\n", self
	"usage: %s [-PklaiThH] [-t|-F only-type]... [-x not-type]... [-B blocksize] [--output[=col[,col]...]] [--[no-]sync] [--total] [path|device]...\n", self


#if __sun


@@ 77,7 77,7 @@ int main(int argc, char * const * argv) {
	std::optional<vore::human_size_t> human_size;
	for(auto && [arg, val] : vore::opt::get{argc,
	                                        argv,
	                                        "PiTlB:kat:x:vHh",
	                                        "PiTlB:kat:F:x:vHh",
	                                        {{"portability", no_argument, nullptr, 'P'},
	                                         {"sync", no_argument, nullptr, 's'},
	                                         {"no-sync", no_argument, nullptr, 'S'},


@@ 149,6 149,7 @@ int main(int argc, char * const * argv) {
				default_filters = false;
				break;
			case 't':
			case 'F':
				if(auto itr = std::lower_bound(exclusive_filters.begin(), exclusive_filters.end(), val); itr == exclusive_filters.end() || val < *itr)
					exclusive_filters.insert(itr, val);
				break;

M man/df.1 => man/df.1 +16 -8
@@ 10,14 10,14 @@
.Sh SYNOPSIS
.Nm
.Op Fl PklaiThH
.Oo Fl t Ar only-type Oc Ns …
.Oo Fl t Ns \&| Ns Fl F Ar only-type Oc Ns …
.Oo Fl x Ar not-type Oc Ns …
.Op Fl B Ar blocksize
.Op Fl -output Ns Oo = Ns Ar col Ns Oo , Ns Ar col Oc Ns … Oc
.Op Fl -sync
.Op Fl -no-sync
.Op Fl -total
.Oo Ar path Ns | Ns Ar device Oc Ns …
.Oo Ar path Ns \&| Ns Ar device Oc Ns …
.
.Sh DESCRIPTION
Lists the free and used space accessible to unprivileged users on mounted filesystems.


@@ 172,7 172,7 @@ Like
.Fl h
but
.Em 1000 .
.It Fl t , -print-type Ns = Ns Ar only-type
.It Fl t , Fl F , -print-type Ns = Ns Ar only-type
Filter out all filesystems with types different than
.Ar only-type Ns s .
.It Fl x , -exclude-type Ns = Ns Ar not-type


@@ 242,13 242,21 @@ blocks.
The only truly portable invocation of
.Nm
is
.Dl $ Ev POSIXLY_CORRECT Ns Li = Nm Fl P Oo Fl k Oc Oo Ar path Ns | Ns Ar device Oc Ns …
.Dl $ Ev POSIXLY_CORRECT Ns Li = Nm Fl P Oo Fl k Oc Oo Ar path Ns \&| Ns Ar device Oc Ns …
.Pp
It also defines a
.Fl t
XSI extension as "Include total allocated-space figures in the output", but leaves it explicitly unspecified; this is good, as
.Fl t Ar only-type
is universally supported.
XSI extension as "Include total allocated-space figures in the output", but leaves it explicitly unspecified \(em
it is supported in that form on
.At III
derivatives; some, like Solaris, provide an
.Fl F
option with the same meaning as this implementation's
.Fl t
.Pq except for Pa /usr/ucb/ Ns Nm , No which provides Fl t No as described .
The
.Fl F t
alias is available but undocumented in the GNU system.
.Pp
This implementation is compatible with the GNU system, which is broken as noted above, more strict about mixing output format flags, disallows block sizes with
.Sy B


@@ 357,7 365,7 @@ doesn't block for mount information.
sees a
.Sx SYNOPSIS
of
.D1 Nm df Oo Fl in Oc Oo Fl t Ar type Oc Op Ar file | Ar filesystem ...
.D1 Nm df Oo Fl in Oc Oo Fl t Ar type Oc Op Ar file \&| Ar filesystem ...
.Fl k
was replaced with a
.Ev BLOCKSIZE