On 06/26, Dan Williams wrote:
> In addition to filtering by bus, dimm, and/or region, introduce
> -n/--namespace to limit the listing to the given namespace.
> 
> Signed-off-by: Dan Williams <[email protected]>
> ---
>  Documentation/ndctl-list.txt |    6 ++++++
>  ndctl/builtin-list.c         |    6 ++++++
>  util/filter.c                |   21 +++++++++++++++++++++
>  util/filter.h                |    2 ++
>  4 files changed, 35 insertions(+)
> 
This needs a bash completion update as follows (feel free to squash in
or keep separatley..):

>From b6d09ff03b7ed16efdc4169aec0442d5c32053bd Mon Sep 17 00:00:00 2001
From: Vishal Verma <[email protected]>
Date: Mon, 27 Jun 2016 13:22:58 -0600
Subject: [PATCH] ndctl: bash completion updates for the --namespace= filter

Add completion for the new --namespace= filter.
This will list idle namespaces for completion. It could possibly be made
smarter by checking if a '--idle' or '-i' has been specified on the
command line so far, but maybe that's a bit confusing for the user?

For now, enable the simpler path of listing everything for completion.

Signed-off-by: Vishal Verma <[email protected]>
---
 contrib/ndctl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/ndctl b/contrib/ndctl
index 5a7455f..b7a82fc 100755
--- a/contrib/ndctl
+++ b/contrib/ndctl
@@ -91,7 +91,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)
 ]]; then
+               if [[ "$cword" == 
@(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace)
 ]]; then
                        COMPREPLY[$i]="${cword}="
                else
                        COMPREPLY[$i]="${cword} "
@@ -146,6 +146,9 @@ __ndctl_comp_options()
                --dimm)
                        opts=$(__ndctl_get_dimms)
                        ;;
+               --namespace)
+                       opts=$(__ndctl_get_ns -i)
+                       ;;
                --reconfig)
                        # It is ok to reconfig disabled namespaces
                        opts=$(__ndctl_get_ns -i)
-- 
2.5.5

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

Reply via email to