"Fossies" - the Fresh Open Source Software Archive

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


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (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="admin-info admin-runcommand batch bes-get-output bes-job-status bes-list-att bes-list-jobs bes-submit-job bes-terminate-job broker-run cat chgrp chmod connect connect-to-testgrid copy-file copy-file-status cp create-storage create-tss download-config exec find get-file get-output issue-delegation job-abort job-restart job-status list-applications list-attributes list-jobs list-sites list-storages list-transfers list-workflows ls metadata mkdir put-file rename reservation resolve rm run run-groovy run-test save-attributes setacl share shell stat system-info umask workflow-control workflow-submit wsrf"
    9   global_opts="--long --raw --configuration --help --output --registry --user --verbose --with-timing --delegationAssertion --authenticationMethod --preference --attributeAssertion --voGroup --includeAttributes --VO --excludeAttributes"
   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     admin-info)
   22     opts="$global_opts --filter --all"
   23     ;;
   24     admin-runcommand)
   25     opts="$global_opts --sitename --url"
   26     ;;
   27     batch)
   28     opts="$global_opts --sitename --input --noFetchOutcome --noResourceCheck --update --jsdl --maxNewJobs --siteWeights --follow --threads --max --keep --submitOnly"
   29     ;;
   30     bes-get-output)
   31     opts="$global_opts "
   32     ;;
   33     bes-job-status)
   34     opts="$global_opts "
   35     ;;
   36     bes-list-att)
   37     opts="$global_opts --sitename"
   38     ;;
   39     bes-list-jobs)
   40     opts="$global_opts --sitename"
   41     ;;
   42     bes-submit-job)
   43     opts="$global_opts --sitename --jsdl --stdout --brief --stderr"
   44     ;;
   45     bes-terminate-job)
   46     opts="$global_opts "
   47     ;;
   48     broker-run)
   49     opts="$global_opts --sitename --noFilenameFix --storageURL --asynchronous --lifetime --factoryURL --dryRun"
   50     ;;
   51     cat)
   52     opts="$global_opts --bytes --protocols"
   53     ;;
   54     chgrp)
   55     opts="$global_opts --recursive"
   56     ;;
   57     chmod)
   58     opts="$global_opts --recursive"
   59     ;;
   60     connect)
   61     opts="$global_opts --lifetime"
   62     ;;
   63     connect-to-testgrid)
   64     opts="$global_opts "
   65     ;;
   66     copy-file)
   67     opts="$global_opts --bytes --target --schedule --force-remote --source --asynchronous --protocols"
   68     ;;
   69     copy-file-status)
   70     opts="$global_opts "
   71     ;;
   72     cp)
   73     opts="$global_opts --schedule --resume --asynchronous --protocols"
   74     ;;
   75     create-storage)
   76     opts="$global_opts --sitename --info --type --lifetime --factoryURL"
   77     ;;
   78     create-tss)
   79     opts="$global_opts --sitename --lifetime --factoryURL"
   80     ;;
   81     download-config)
   82     opts="$global_opts --assumeyes --newtruststore --updateexisting"
   83     ;;
   84     exec)
   85     opts="$global_opts --sitename --broker --dryRun --keep"
   86     ;;
   87     find)
   88     opts="$global_opts --name --recursive"
   89     ;;
   90     get-file)
   91     opts="$global_opts --bytes --append --target --recursive --source --protocols"
   92     ;;
   93     get-output)
   94     opts="$global_opts --brief"
   95     ;;
   96     issue-delegation)
   97     opts="$global_opts --sitename --file --target --validity --subject"
   98     ;;
   99     job-abort)
  100     opts="$global_opts "
  101     ;;
  102     job-restart)
  103     opts="$global_opts "
  104     ;;
  105     job-status)
  106     opts="$global_opts --all"
  107     ;;
  108     list-applications)
  109     opts="$global_opts --sitename --filter --all"
  110     ;;
  111     list-attributes)
  112     opts="$global_opts "
  113     ;;
  114     list-jobs)
  115     opts="$global_opts --sitename --filter --all"
  116     ;;
  117     list-sites)
  118     opts="$global_opts --sitename --filter --all"
  119     ;;
  120     list-storages)
  121     opts="$global_opts --filter --all"
  122     ;;
  123     list-transfers)
  124     opts="$global_opts --filter --all"
  125     ;;
  126     list-workflows)
  127     opts="$global_opts --filter --nofiles --all --nojobs"
  128     ;;
  129     ls)
  130     opts="$global_opts --human --show-metadata --recursive"
  131     ;;
  132     metadata)
  133     opts="$global_opts --query --wait --file --storage --metadata-service --advanced-query --command"
  134     ;;
  135     mkdir)
  136     opts="$global_opts "
  137     ;;
  138     put-file)
  139     opts="$global_opts --bytes --append --target --recursive --source --protocols"
  140     ;;
  141     rename)
  142     opts="$global_opts "
  143     ;;
  144     reservation)
  145     opts="$global_opts --sitename --jsdl --delete --start --list"
  146     ;;
  147     resolve)
  148     opts="$global_opts --full"
  149     ;;
  150     rm)
  151     opts="$global_opts --quiet"
  152     ;;
  153     run)
  154     opts="$global_opts --sitename --broker --stdout --jsdl --schedule --asynchronous --stderr --dryRun --example --brief"
  155     ;;
  156     run-groovy)
  157     opts="$global_opts --expression --file"
  158     ;;
  159     run-test)
  160     opts="$global_opts --expression --file"
  161     ;;
  162     save-attributes)
  163     opts="$global_opts --prettifyAssertion --attributeListOutFile"
  164     ;;
  165     setacl)
  166     opts="$global_opts --delete --recursive --clean"
  167     ;;
  168     share)
  169     opts="$global_opts --delete --clean"
  170     ;;
  171     shell)
  172     opts="$global_opts --file"
  173     ;;
  174     stat)
  175     opts="$global_opts --human --show-metadata"
  176     ;;
  177     system-info)
  178     opts="$global_opts "
  179     ;;
  180     umask)
  181     opts="$global_opts --set"
  182     ;;
  183     workflow-control)
  184     opts="$global_opts "
  185     ;;
  186     workflow-submit)
  187     opts="$global_opts --sitename --noFilenameFix --wait --workflowName --storageURL --lifetime --factoryURL --dryRun --uccInput"
  188     ;;
  189 
  190     wsrf)
  191     #looking for wsrf command
  192     if [ $COMP_CWORD -eq 2 ]; then
  193       opts="getproperties destroy extend"
  194     else
  195       opts="$global_opts "
  196     fi
  197     ;;
  198   esac
  199   
  200   COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
  201   
  202   _filedir
  203 
  204 }
  205 
  206 complete -o filenames -F _ucc ucc