From 4f4eb606dd25861c25d8da8010e347b28fae7c5d Mon Sep 17 00:00:00 2001 From: Matt Macy Date: Sat, 19 May 2018 18:15:41 +0000 Subject: [PATCH] bhnd nvram map: don't write "variable records written" to standard out by default Add -v (verbose) option for the developers. The rest of us derive no value from this information. --- sys/dev/bhnd/tools/nvram_map_gen.awk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/bhnd/tools/nvram_map_gen.awk b/sys/dev/bhnd/tools/nvram_map_gen.awk index 469071df5b66..29061691105f 100755 --- a/sys/dev/bhnd/tools/nvram_map_gen.awk +++ b/sys/dev/bhnd/tools/nvram_map_gen.awk @@ -56,6 +56,7 @@ function main(_i) { OUT_T = null OUT_T_HEADER = "HEADER" OUT_T_DATA = "DATA" + VERBOSE = 0 # Tab width to use when calculating output alignment TAB_WIDTH = 8 @@ -77,6 +78,8 @@ function main(_i) { OUT_T = OUT_T_DATA } else if (ARGV[_i] == "-h" && OUT_T == null) { OUT_T = OUT_T_HEADER + } else if (ARGV[_i] == "-v") { + VERBOSE = 1 } else if (ARGV[_i] == "-o") { _i++ if (_i >= ARGC) @@ -488,9 +491,10 @@ function at_exit(_block_start, _state, _output_vars, _noutput_vars, _name, _var, } else if (OUT_T == OUT_T_HEADER) { write_header(_output_vars) } - - printf("%u variable records written to %s\n", array_size(_output_vars), - OUTPUT_FILE) >> "/dev/stderr" + if (VERBOSE == 1) { + printf("%u variable records written to %s\n", array_size(_output_vars), + OUTPUT_FILE) >> "/dev/stderr" + } } # Write the public header (output type HEADER)