Skip to contentSkip to conversation

ndctl, bash-completion: updates for --mode options

PATCH In review Vishal Verma 2 participants 2 messages Nov 21, 2017 – Nov 22, 2017 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl, bash-completion: updates for --mode options

With the updates to --mode for create-namespace, deprecate the old names from bash completion. The man page removes mention of the old names, so remove them from the completion output as well to avoid confusion.

Add the new names into the mode filtering scheme alongside the old names so that the same filtering behaviour is seen regardless of whether a user supplies old or new names.

---
 contrib/ndctl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
contrib/ndctl +4 -4
index d983868..fb0d421 100755
@@ -143,9 +143,9 @@ __ndctl_get_dimms()
 
 __ndctl_get_sector_sizes()
 {
-	if [[ "$mode_filter" == @(raw|memory) ]]; then
+	if [[ "$mode_filter" == @(raw|memory|fsdax) ]]; then
 		echo "512 4096"
-	elif [[ "$mode_filter" == @(dax) ]]; then
+	elif [[ "$mode_filter" == @(dax|devdax) ]]; then
 		return
 	else
 		echo "512 520 528 4096 4104 4160 4224"
@@ -183,12 +183,12 @@ __ndctl_comp_options()
 			;;
 		--type)
 			opts="pmem blk"
-			if [[ "$mode_filter" == @(dax|memory) ]]; then
+			if [[ "$mode_filter" == @(dax|memory|fsdax|devdax) ]]; then
 				opts="pmem"
 			fi
 			;;
 		--mode)
-			opts="raw sector fsdax devdax memory dax"
+			opts="raw sector fsdax devdax"
 			if [[ "$type_filter" == "blk" ]]; then
 				opts="raw sector"
 			fi
Signature · 6 lines
2.14.3

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw
Quoted 7 lines · Vishal Verma

With the updates to --mode for create-namespace, deprecate the old names from bash completion. The man page removes mention of the old names, so remove them from the completion output as well to avoid confusion.

Add the new names into the mode filtering scheme alongside the old names so that the same filtering behaviour is seen regardless of whether a user supplies old or new names.

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