From: Thomas Weißschuh Date: Mon, 31 Jul 2023 16:00:05 +0000 (+0200) Subject: fincore: add --output-all X-Git-Tag: v2.40-rc1~314^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f583cb99b3593bf7375b824ab61f43fef154eb9;p=thirdparty%2Futil-linux.git fincore: add --output-all Signed-off-by: Thomas Weißschuh --- diff --git a/bash-completion/fincore b/bash-completion/fincore index 3639763b56..f0f9c45f17 100644 --- a/bash-completion/fincore +++ b/bash-completion/fincore @@ -30,6 +30,7 @@ _fincore_module() --bytes --noheadings --output + --output-all --raw --help --version diff --git a/misc-utils/fincore.1.adoc b/misc-utils/fincore.1.adoc index 54ed23677d..4e1797a756 100644 --- a/misc-utils/fincore.1.adoc +++ b/misc-utils/fincore.1.adoc @@ -38,6 +38,9 @@ include::man-common/in-bytes.adoc[] Define output columns. See the *--help* output to get a list of the currently supported columns. The default list of columns may be extended if _list_ is specified in the format _{plus}list_. //TRANSLATORS: Keep {plus} untranslated. +*--output-all*:: +Output all available columns. + *-r*, *--raw*:: Produce output in raw format. All potentially unsafe characters are hex-escaped (\x). diff --git a/misc-utils/fincore.c b/misc-utils/fincore.c index c92d10b544..d574eae501 100644 --- a/misc-utils/fincore.c +++ b/misc-utils/fincore.c @@ -278,6 +278,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -b, --bytes print sizes in bytes rather than in human readable format\n"), out); fputs(_(" -n, --noheadings don't print headings\n"), out); fputs(_(" -o, --output output columns\n"), out); + fputs(_(" --output-all output all columns\n"), out); fputs(_(" -r, --raw use raw output format\n"), out); fputs(USAGE_SEPARATOR, out); @@ -304,10 +305,14 @@ int main(int argc, char ** argv) .pagesize = getpagesize() }; + enum { + OPT_OUTPUT_ALL = CHAR_MAX + 1 + }; static const struct option longopts[] = { { "bytes", no_argument, NULL, 'b' }, { "noheadings", no_argument, NULL, 'n' }, { "output", required_argument, NULL, 'o' }, + { "output-all", no_argument, NULL, OPT_OUTPUT_ALL }, { "version", no_argument, NULL, 'V' }, { "help", no_argument, NULL, 'h' }, { "json", no_argument, NULL, 'J' }, @@ -331,6 +336,10 @@ int main(int argc, char ** argv) case 'o': outarg = optarg; break; + case OPT_OUTPUT_ALL: + for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) + columns[ncolumns] = ncolumns; + break; case 'J': ctl.json = 1; break;