Whamcloud - gitweb
LU-13225 utils: bash completion for lfs and lctl 19/38519/5
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 8 Feb 2020 08:25:29 +0000 (01:25 -0700)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Jul 2020 07:28:02 +0000 (07:28 +0000)
commit46e3ebb920a4408cf57b548b1ea8efb1a51e654a
tree345a4df7e665213ff9c8930f0b58d856948e76c9
parent7f821c9382c39fd16156593569737df27dfb0467
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 more that could be added to the completions,
but this is a good start and provides a framework for the future.

Lustre-change: https://review.whamcloud.com/37483
Lustre-commit: dfb4afc24102ee305d4901dc76944f4c91887633

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie989b2ef4c0d6d8565e5c6753205bb6ed83ebbe5
Reviewed-by: Dominique Martinet <dominique.martinet@cea.fr>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: Ben Evans <beevans@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-on: https://review.whamcloud.com/38519
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
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