"Fossies" - the Fresh Open Source Software Archive

Member "unicore-ucc-8.0.2/extras/bash-completion/ucc_bash_completion.template" (18 May 2020, 755 Bytes) of package /linux/misc/unicore-ucc-8.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 _ucc()
    3 {
    4   local cur prev commands global_opts opts
    5   COMPREPLY=()
    6   cur=`_get_cword`
    7   prev="${COMP_WORDS[COMP_CWORD-1]}"
    8   commands="%(commands)s"
    9   global_opts="%(global_opts)s"
   10 
   11 
   12   # parsing for ucc command word (2nd word in commandline.
   13   # ucc <command> [OPTIONS] <args>)
   14   if [ $COMP_CWORD -eq 1 ]; then
   15     COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) )
   16     return 0
   17   fi
   18 
   19   # looking for arguments matching to command
   20   case "${COMP_WORDS[1]}" in
   21 %(case_body)s
   22     wsrf)
   23     #looking for wsrf command
   24     if [ $COMP_CWORD -eq 2 ]; then
   25       opts="getproperties destroy extend"
   26     else
   27       opts="$global_opts "
   28     fi
   29     ;;
   30   esac
   31   
   32   COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
   33   
   34   _filedir
   35 
   36 }
   37 
   38 complete -o filenames -F _ucc ucc