diff mbox series

[ndctl] ndctl, bash-completion: add helpers for security commands

Message ID 20190201223408.18823-1-vishal.l.verma@intel.com (mailing list archive)
State Accepted
Commit 861c67d94efd89c39c87e4e9d55111a4d022a98d
Headers show
Series [ndctl] ndctl, bash-completion: add helpers for security commands | expand

Commit Message

Vishal Verma Feb. 1, 2019, 10:34 p.m. UTC
Add bash completion helpers for security-related commands and their
options.

Cc: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 contrib/ndctl | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/contrib/ndctl b/contrib/ndctl
index 629d6a8..e17fb0b 100755
--- a/contrib/ndctl
+++ b/contrib/ndctl
@@ -116,7 +116,7 @@  __ndctlcomp()
 
 	COMPREPLY=( $( compgen -W "$1" -- "$2" ) )
 	for cword in "${COMPREPLY[@]}"; do
-		if [[ "$cword" == @(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace|--input|--output|--label-version|--align|--block|--count|--firmware|--media-temperature|--ctrl-temperature|--spares|--media-temperature-threshold|--ctrl-temperature-threshold|--spares-threshold|--media-temperature-alarm|--ctrl-temperature-alarm|--spares-alarm|--numa-node|--log|--dimm-event|--config-file) ]]; then
+		if [[ "$cword" == @(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace|--input|--output|--label-version|--align|--block|--count|--firmware|--media-temperature|--ctrl-temperature|--spares|--media-temperature-threshold|--ctrl-temperature-threshold|--spares-threshold|--media-temperature-alarm|--ctrl-temperature-alarm|--spares-alarm|--numa-node|--log|--dimm-event|--config-file|--key-handle|--key-path|--tpm-handle) ]]; then
 			COMPREPLY[$i]="${cword}="
 		else
 			COMPREPLY[$i]="${cword} "
@@ -298,6 +298,10 @@  __ndctl_comp_options()
 			__ndctl_file_comp "$cur_arg"
 			return
 			;;
+		--key-path)
+			__ndctl_file_comp "$cur_arg"
+			return
+			;;
 		*)
 			return
 			;;
@@ -358,6 +362,19 @@  __ndctl_comp_non_option_args()
 	start-scrub)
 		opts="$(__ndctl_get_buses) all"
 		;;
+	setup-passphrase)
+		;&
+	update-passphrase)
+		;&
+	remove-passphrase)
+		;&
+	freeze-security)
+		;&
+	sanitize-dimm)
+		;&
+	wait-overwrite)
+		opts="$(__ndctl_get_dimms -i) all"
+		;;
 	*)
 		return
 		;;