From: WanBingjiang Date: Fri, 27 Feb 2026 08:34:27 +0000 (+0800) Subject: man: hide LIBSMARTCOLS_JSON in man pages that do not support --json X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ed21d80d218d55c01fee1528f51d31da92a9376;p=thirdparty%2Futil-linux.git man: hide LIBSMARTCOLS_JSON in man pages that do not support --json PR #4070 consolidated libsmartcols env vars into man-common/env-smartcols.adoc and had all tools (including fdisk and cfdisk) include it. That documented LIBSMARTCOLS_JSON in fdisk/cfdisk man pages although those tools do not support --json output, which is misleading. Use ifdef::smartcols-json[] in env-smartcols.adoc so the JSON env var section is only rendered for man pages that set :smartcols-json: (column, lsblk, findmnt, sfdisk). fdisk and cfdisk include the same file but do not set the attribute, so they only show the debug-related variables. Addresses: util-linux#4070 --- diff --git a/disk-utils/sfdisk.8.adoc b/disk-utils/sfdisk.8.adoc index 5b9613ad9..f6b483050 100644 --- a/disk-utils/sfdisk.8.adoc +++ b/disk-utils/sfdisk.8.adoc @@ -20,6 +20,7 @@ ifdef::neverdefined[---] :man source: util-linux {release-version} :page-layout: base :command: sfdisk +:smartcols-json: :plus: + :asterisk: * diff --git a/man-common/env-smartcols.adoc b/man-common/env-smartcols.adoc index d5c34319c..5f0a9ba7c 100644 --- a/man-common/env-smartcols.adoc +++ b/man-common/env-smartcols.adoc @@ -4,8 +4,10 @@ enables libsmartcols debug output. *LIBSMARTCOLS_DEBUG_PADDING*=on:: use visible padding characters. +ifdef::smartcols-json[] *LIBSMARTCOLS_JSON*=compact|lines:: Controls JSON output format when using *--json*. Supported values are *compact* for JSON output with minimal whitespace, and *lines* for JSON Lines format (one JSON object per line). If unset or set to any other value, pretty-printed JSON is used. +endif::smartcols-json[] diff --git a/misc-utils/findmnt.8.adoc b/misc-utils/findmnt.8.adoc index 38220fb24..e1afa96af 100644 --- a/misc-utils/findmnt.8.adoc +++ b/misc-utils/findmnt.8.adoc @@ -5,6 +5,7 @@ :man source: util-linux {release-version} :page-layout: base :command: findmnt +:smartcols-json: :plus: + == NAME diff --git a/misc-utils/lsblk.8.adoc b/misc-utils/lsblk.8.adoc index 4071411f2..3c873f0f3 100644 --- a/misc-utils/lsblk.8.adoc +++ b/misc-utils/lsblk.8.adoc @@ -5,6 +5,7 @@ :man source: util-linux {release-version} :page-layout: base :command: lsblk +:smartcols-json: == NAME diff --git a/text-utils/column.1.adoc b/text-utils/column.1.adoc index e20f8ecbf..e6386b7a4 100644 --- a/text-utils/column.1.adoc +++ b/text-utils/column.1.adoc @@ -41,6 +41,7 @@ ifdef::neverdefined[---] :man source: util-linux {release-version} :page-layout: base :command: column +:smartcols-json: == NAME