Skip to contentSkip to conversation

ndctl: bash completion for {enable, disable}-dimm commands

PATCH In review Vishal Verma 1 participant 2 messages Sep 19, 2016 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl: bash completion for {enable, disable}-dimm commands

Add bash completion for the two new commands. Don't add a "-i" by default in __ndctl_get_dimms, instead specift "-i" manually where needed (everywhere except the completion for disable-dimm)

---
 contrib/ndctl | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
contrib/ndctl +9 -4
index 160a9dc..2c04504 100755
@@ -127,8 +127,7 @@ __ndctl_get_ns()
 
 __ndctl_get_dimms()
 {
-	# when listing dimms, always list idle ones too
-	opts="--dimms -i $*"
+	opts="--dimms $*"
 	[ -n "$bus_filter" ] && opts="$opts --bus=$bus_filter"
 	echo "$(ndctl list $opts | grep -E "^\s*\"dev\":" | cut -d\" -f4)"
 }
@@ -148,7 +147,7 @@ __ndctl_comp_options()
 			opts=$(__ndctl_get_regions)
 			;;
 		--dimm)
-			opts=$(__ndctl_get_dimms)
+			opts=$(__ndctl_get_dimms -i)
 			;;
 		--namespace)
 			opts=$(__ndctl_get_ns)
@@ -201,10 +200,16 @@ __ndctl_comp_non_option_args()
 	disable-region)
 		opts="$(__ndctl_get_regions) all"
 		;;
+	enable-dimm)
+		opts="$(__ndctl_get_dimms -i) all"
+		;;
+	disable-dimm)
+		opts="$(__ndctl_get_dimms) all"
+		;;
 	read-labels)
 		;&
 	zero-labels)
-		opts="$(__ndctl_get_dimms) all"
+		opts="$(__ndctl_get_dimms -i) all"
 		;;
 	*)
 		return
Signature · 6 lines
2.7.4

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
author maintainer
#1 lore raw

Re: [ndctl PATCH] ndctl: bash completion for {enable,disable}-dimm commands

Quoted 2 lines · Vishal Verma

Add bash completion for the two new commands. Don't add a "-i" by default in __ndctl_get_dimms, instead specift "-i" manually where needed

s/specifit/specify/

Quoted 7 lines

(everywhere except the completion for disable-dimm)

---
 contrib/ndctl | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm