LU-17205 utils: add lctl get_param -H option
- Add a new '-H' option to 'lctl get_param' that will prefix
each output line with the parameter name instead of only
the first line by default.
That makes grepping lctl get_param with wildcards much easier
as you can now easily know which parameter returns which value.
$ lctl get_param -H osc.*.state | grep current
osc.lustre-OST0000-osc-
ff1148c0.state=current_state: FULL
osc.lustre-OST0001-osc-
ff1248c0.state=current_state: DISCONN
osc.lustre-OST0002-osc-
ff1348c0.state=current_state: FULL
osc.lustre-OST0003-osc-
ff1448c0.state=current_state: FULL
osc.lustre-OST0004-osc-
ff1548c0.state=current_state: FULL
It also prints an output line even for empty values. That also
makes like easier for admins.
- The patch also removes the force line feed if the parameter
value was larger than 80 chars. This was considered a misfeature
and is now drop for all usages, with or without -H.
Test-Parameters: trivial
Signed-off-by: Aurelien Degremont <adegremont@nvidia.com>
Change-Id: Ib1fa0dc400db4c19fed10ad4cced9be5668418e3
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52730
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>