Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completions - generate_completions script works in py3 #5315

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 95 additions & 57 deletions etc/crab-bash-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,51 @@ _UseCrab ()
"")
case "$cur" in
"")
COMPREPLY=( $(compgen -W '--version --help -h --quiet --debug status tasks proceed checkwrite getlog checkusername checkdataset checkfile submit getoutput resubmit kill uploadlog remake report preparelocal createmyproxy setdatasetstatus setfilestatus' -- $cur) )
COMPREPLY=( $(compgen -W '--version --help -h --quiet --debug status tasks submit proceed checkdataset checkfile checkusername checkwrite createmyproxy getlog getoutput getsandbox kill preparelocal recover remake report resubmit setdatasetstatus setfilestatus uploadlog' -- $cur) )
;;
-*)
COMPREPLY=( $(compgen -W '--version --help -h --quiet --debug' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -W 'status tasks proceed checkwrite getlog checkusername checkdataset checkfile submit getoutput resubmit kill uploadlog remake report preparelocal createmyproxy setdatasetstatus setfilestatus' -- $cur) )
COMPREPLY=( $(compgen -W 'status tasks submit proceed checkdataset checkfile checkusername checkwrite createmyproxy getlog getoutput getsandbox kill preparelocal recover remake report resubmit setdatasetstatus setfilestatus uploadlog' -- $cur) )
;;
esac
;;

"tasks")
"checkdataset")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --fromdate --days --status --proxy --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --dataset --dbs-instance --proxy' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"chkd")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --dataset --dbs-instance --proxy' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"checkfile")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --checksum --lfn --dbs-instance --rucio-scope --proxy' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"checkusername")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --proxy' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
Expand All @@ -54,150 +84,150 @@ _UseCrab ()
esac
;;

"getlog")
"chkw")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --short --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --site --lfn --checksum --command --proxy --voRole --voGroup' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"kill")
"createmyproxy")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --killwarning --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --days --proxy --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"rmk")
"getlog")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --task --proxy --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --short --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --voRole --voGroup --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"out")
"log")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --short --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --voRole --voGroup --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"sub")
"getoutput")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --wait --dryrun --skip-estimates --config -c --proxy --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --voRole --voGroup --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"rep")
"output")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --outputdir --recovery --dbs --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --voRole --voGroup --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"chkw")
"out")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --site --lfn --checksum --command --proxy --voRole --voGroup' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --voRole --voGroup --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"checkusername")
"getsandbox")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --proxy' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"submit")
"kill")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --wait --dryrun --skip-estimates --config -c --proxy --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --killwarning --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"getoutput")
"preparelocal")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --enableStageout --jobid --destdir --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"resubmit")
"proceed")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --wait --force --publication --jobids --sitewhitelist --siteblacklist --maxjobruntime --maxmemory --numcores --priority --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"status")
"recover")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --long --json --summary --verboseErrors --sort --jobids --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --forcekill --strategy --destinstance --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"uplog")
"rec")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --logpath --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --forcekill --strategy --destinstance --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"log")
"remake")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --short --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --task --proxy --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"uploadlog")
"rmk")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --logpath --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --task --proxy --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
Expand All @@ -214,113 +244,121 @@ _UseCrab ()
esac
;;

"proceed")
"rep")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --outputdir --recovery --dbs --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"st")
"resubmit")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --long --json --summary --verboseErrors --sort --jobids --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --force --publication --jobids --sitewhitelist --siteblacklist --maxjobruntime --maxmemory --numcores --priority --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"remake")
"setdatasetstatus")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --task --proxy --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --recursive --dbs-instance --dataset --status --proxy' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"output")
"setfilestatus")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --dump --xrootd --quantity --parallel --wait --outputpath --jobids --checksum --command --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --dbs-instance --dataset -d --status -s --files -f --proxy' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"preparelocal")
"status")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --jobid --enableStageout --destdir --proxy --dir -d --task --instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --long --json --summary --verboseErrors --sort --jobids --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"createmyproxy")
"st")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --days' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --long --json --summary --verboseErrors --sort --jobids --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"checkdataset")
"submit")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --dataset' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --wait --dryrun --skip-estimates --config -c --proxy --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"checkfile")
"sub")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --lfn --dbs-instance --rucio-scope --checksum' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --wait --dryrun --skip-estimates --config -c --proxy --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"setdatasetstatus")
"tasks")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --status --dataset --dbs-instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --fromdate --days --status --proxy --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"setfilestatus")
"uploadlog")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --status --dataset --files --dbs-instance' -- $cur) )
COMPREPLY=( $(compgen -W '--help -h --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

"uplog")
case "$cur" in
-*)
COMPREPLY=( $(compgen -W '--help -h --proxy --dir -d --task --instance' -- $cur) )
;;
*)
COMPREPLY=( $(compgen -f $cur) )
esac
;;

*)
COMPREPLY=( $(compgen -W 'status tasks proceed checkwrite getlog checkusername checkdataset checkfile submit getoutput resubmit kill uploadlog remake report preparelocal setdatasetstatus setfilestatus' -- $cur) )
COMPREPLY=( $(compgen -W 'status tasks submit proceed checkdataset checkfile checkusername checkwrite createmyproxy getlog getoutput getsandbox kill preparelocal recover remake report resubmit setdatasetstatus setfilestatus uploadlog' -- $cur) )
;;
esac

return 0
}
complete -F _UseCrab -o filenames crab

complete -F _UseCrab -o filenames -o nosort crab
Loading