Whamcloud - gitweb
LU-13225 utils: bash completion for lfs and lctl 83/37483/12
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 8 Feb 2020 08:25:29 +0000 (01:25 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:51:40 +0000 (05:51 +0000)
commitdfb4afc24102ee305d4901dc76944f4c91887633
treefb2c09fc23579a15cf1ae8734092a33707cb1783
parente32ca6e12edbd885838f8a12c0edd455b9ad7105
LU-13225 utils: bash completion for lfs and lctl

Add a bash completion for "lfs" and improve completion for "lctl".
Rename the "lctl" completion script to "lustre" since the two
commands share helper routines for fsnames, pools, etc. and install
"lfs" and "lctl" symlinks to the common command file.

The completion prints available sub-commands and their options,
and for some sub-commands it completes available arguments
(e.g. mount points, pool names, and MDT/OST names).

A couple of minor changes to "lfs" and "lctl" usage messages to make
the sub-command options easier to parse.  More needs to be done to
make all sub-commands have proper long options.

There is definitely a lot more that could be added to the completions,
but this is a good start and provides a framework for the future.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie989b2ef4c0d6d8565e5c6753205bb6ed83ebbe5
Reviewed-on: https://review.whamcloud.com/37483
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Dominique Martinet <dominique.martinet@cea.fr>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/scripts/Makefile.am
lustre/scripts/bash-completion/lctl [changed from file to symlink]
lustre/scripts/bash-completion/lfs [new symlink]
lustre/scripts/bash-completion/lustre [new file with mode: 0644]
lustre/utils/lctl.c
lustre/utils/lfs.c
lustre/utils/wiretest.c