]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
keymgr: colorize output to terminals only
authorDavid Vašek <david.vasek@nic.cz>
Tue, 17 Aug 2021 20:40:07 +0000 (22:40 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 25 Aug 2021 15:20:56 +0000 (17:20 +0200)
doc/man/keymgr.8in
doc/man_keymgr.rst
src/utils/keymgr/main.c

index 48739f5f1c7fa69882b3b5bc7947ebc5b3202d8b..98d8a9423f63b0730ba73e417a64cc92ba6bc56e 100644 (file)
@@ -60,7 +60,7 @@ TSIG key is only displayed on \fIstdout\fP: the command does not create a file,
 key in a keystore.
 .TP
 \fB\-b\fP, \fB\-\-brief\fP
-List keys briefly.
+List keys briefly. Output to a terminal is colorized.
 .TP
 \fB\-l\fP, \fB\-\-list\fP
 Print the list of zones that have at least one key stored in the configured KASP
index b6554df43126ab84425928c7d29b61a2c239bab3..5edba45280dd17bcfd431f95a70561b31de8b3b6 100644 (file)
@@ -37,7 +37,7 @@ Basic options
   key in a keystore.
 
 **-b**, **--brief**
-   List keys briefly.
+  List keys briefly. Output to a terminal is colorized.
 
 **-l**, **--list**
   Print the list of zones that have at least one key stored in the configured KASP
index 0da4397eb1066a04c4f631b7855ff82c6b7d9c2e..b1629323acc92812a79aca0573e2d8e8aaa01286 100644 (file)
@@ -423,7 +423,7 @@ int main(int argc, char *argv[])
                        break;
                case 'b':
                        list_params.brief = true;
-                       list_params.color = true; // TODO: disable if not stdout
+                       list_params.color = isatty(STDOUT_FILENO);
                        break;
                default:
                        print_help();