Commit 7ddb87ae authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added bash_completion file for 'vos_group' CLI.

parent 04c0f8f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ WORKDIR /home/client/

# Source bash-completion scripts
RUN echo ". /usr/share/bash-completion/completions/vos_data" >> .bashrc && \
    echo ". /usr/share/bash-completion/completions/vos_group" >> .bashrc && \
    echo ". /usr/share/bash-completion/completions/vos_job" >> .bashrc && \
    echo ". /usr/share/bash-completion/completions/vos_storage" >> .bashrc
    
+20 −0
Original line number Diff line number Diff line
_vos_group()
{
  local cur prev opts1 opts2
  COMPREPLY=()
  cur="${COMP_WORDS[COMP_CWORD]}"
  prev="${COMP_WORDS[COMP_CWORD-1]}"
  opts1="read write"
  opts2="add del list"
  
  if [[ ${cur} == read || ${cur} == write || ${COMP_CWORD} -eq 1 ]] ; then
    COMPREPLY=( $(compgen -W "${opts1}" -- ${cur}) )
    return 0
  fi

  if [[ ${prev} == read || ${prev} == write ]] ; then
    COMPREPLY=( $(compgen -W "${opts2}" -- ${cur}) )
    return 0
  fi
}
complete -F _vos_group vos_group