]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
man: hide LIBSMARTCOLS_JSON in man pages that do not support --json
authorWanBingjiang <wanbingjiang@webray.com.cn>
Fri, 27 Feb 2026 08:34:27 +0000 (16:34 +0800)
committerWanBingjiang <wanbingjiang@webray.com.cn>
Fri, 27 Feb 2026 08:34:27 +0000 (16:34 +0800)
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

disk-utils/sfdisk.8.adoc
man-common/env-smartcols.adoc
misc-utils/findmnt.8.adoc
misc-utils/lsblk.8.adoc
text-utils/column.1.adoc

index 5b9613ad95220f9c80f25783b5844218daf37b86..f6b48305066ae7bc18b18bc056977c8ff013b1f4 100644 (file)
@@ -20,6 +20,7 @@ ifdef::neverdefined[---]
 :man source: util-linux {release-version}
 :page-layout: base
 :command: sfdisk
+:smartcols-json:
 :plus: +
 :asterisk: *
 
index d5c34319cbd75f029cdf415d5daf93e757877d94..5f0a9ba7caaa2d827abe8cb939b5ce189c81d095 100644 (file)
@@ -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[]
index 38220fb2472ecf3f169eedd9ebce3a2c936d6567..e1afa96af8010fd3c807e1d2f50ccd78d972e128 100644 (file)
@@ -5,6 +5,7 @@
 :man source: util-linux {release-version}
 :page-layout: base
 :command: findmnt
+:smartcols-json:
 :plus: +
 
 == NAME
index 4071411f270aac1e26111a114fb1d6b9bd50fe9d..3c873f0f359d4e0614758c8222b207fce5581ecf 100644 (file)
@@ -5,6 +5,7 @@
 :man source: util-linux {release-version}
 :page-layout: base
 :command: lsblk
+:smartcols-json:
 
 == NAME
 
index e20f8ecbf80e5d94793f396a2cd665f3a93f3fd7..e6386b7a49d2c686837c5dfb3f5fb70780b133ec 100644 (file)
@@ -41,6 +41,7 @@ ifdef::neverdefined[---]
 :man source: util-linux {release-version}
 :page-layout: base
 :command: column
+:smartcols-json:
 
 == NAME