]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsclocks: add --output-all
authorThomas Weißschuh <thomas@t-8ch.de>
Mon, 3 Jul 2023 15:55:40 +0000 (17:55 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Mon, 3 Jul 2023 16:05:45 +0000 (18:05 +0200)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
bash-completion/lsclocks
misc-utils/lsclocks.1.adoc
misc-utils/lsclocks.c

index bd81d88bc2d745b335d692cb93a6694583007d6d..6048323c9524723ccb424459612c7034e5b03bc1 100644 (file)
@@ -15,6 +15,9 @@ _lsclocks_module()
                '-o'|'--output')
                        return 0
                        ;;
+               '--output-all')
+                       return 0
+                       ;;
                '-r'|'--raw')
                        return 0
                        ;;
@@ -32,6 +35,7 @@ _lsclocks_module()
                        OPTS="--json
                                --noheadings
                                --output
+                               --output-all
                                --raw
                                --time
                                --help
index 5c7f5eac43e62dc1f4f85ea4f32907deae6f4bcf..1eb8b952a79a0fc05f94bcdfc7ce2366586a2f58 100644 (file)
@@ -33,6 +33,9 @@ Don't print headings.
 Specify which output columns to print. See the *OUTPUT COLUMNS*
 section for details of available columns.
 
+*--output-all*::
+Output all columns.
+
 *-r*, *--raw*::
 Use raw output format.
 
index 8531e9fe329d0f65a9022f8412a654fa99c51f99..b15e69cf3e6b295cccfd7a054da4e2ee81ba8c70 100644 (file)
@@ -146,6 +146,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -J, --json              use JSON output format\n"), out);
        fputs(_(" -n, --noheadings        don't print headings\n"), out);
        fputs(_(" -o, --output <list>     output columns\n"), out);
+       fputs(_("     --output-all        output all columns\n"), out);
        fputs(_(" -r, --raw               use raw output format\n"), out);
        fputs(_(" -t, --time <clock>      show current time of single clock\n"), out);
 
@@ -208,8 +209,7 @@ static clockid_t parse_clock(const char *name)
 int main(int argc, char **argv)
 {
        size_t i, j;
-       char c;
-       int rc;
+       int c, rc;
        const struct colinfo *colinfo;
        const struct clockinfo *clockinfo;
 
@@ -226,9 +226,13 @@ int main(int argc, char **argv)
        struct timespec resolution, now;
        char buf[FORMAT_TIMESTAMP_MAX];
 
+       enum {
+               OPT_OUTPUT_ALL = CHAR_MAX + 1
+       };
        static const struct option longopts[] = {
                { "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' },
@@ -250,6 +254,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':
                        json = true;
                        break;