@@ -544,7 +544,7 @@ __daxctlcomp()
COMPREPLY=( $( compgen -W "$1" -- "$2" ) )
for cword in "${COMPREPLY[@]}"; do
- if [[ "$cword" == @(--region|--dev) ]]; then
+ if [[ "$cword" == @(--region|--dev|--mode) ]]; then
COMPREPLY[$i]="${cword}="
else
COMPREPLY[$i]="${cword} "
@@ -569,6 +569,9 @@ __daxctl_comp_options()
--dev)
opts="$(__daxctl_get_devs -i)"
;;
+ --mode)
+ opts="system-ram devdax"
+ ;;
*)
return
;;
@@ -579,8 +582,19 @@ __daxctl_comp_options()
__daxctl_comp_non_option_args()
{
- # there aren't any commands that accept non option arguments yet
- return
+ local subcmd=$1
+ local cur=$2
+ local opts
+
+ case $subcmd in
+ reconfigure-device)
+ opts="$(__daxctl_get_devs -i) all"
+ ;;
+ *)
+ return
+ ;;
+ esac
+ __daxctlcomp "$opts" "$cur"
}
__daxctl_main()
Add bash completion helpers for the new daxctl-reconfigure-device command. Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- contrib/ndctl | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)