]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: add support for LSLOCKS_COLUMNS environmental variable
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Sat, 30 Aug 2025 06:07:48 +0000 (02:07 -0400)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Tue, 2 Sep 2025 16:58:36 +0000 (12:58 -0400)
This provides an alternate way to specify output columns similar
to the --output option.

Addresses: #2816
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
misc-utils/lslocks.c

index 4ed3a371660ffbdd90350da4078a69510cef5a6b..ad8da240bdebce1725fcee482c4576b5b8f0fca1 100644 (file)
@@ -952,6 +952,8 @@ int main(int argc, char *argv[])
                columns[ncolumns++] = COL_PATH;
        }
 
+       if (!outarg)
+               outarg = getenv("LSLOCKS_COLUMNS");
        if (outarg && string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns),
                                         &ncolumns, column_name_to_id) < 0)
                return EXIT_FAILURE;