File tree Expand file tree Collapse file tree 2 files changed +12
-22
lines changed Expand file tree Collapse file tree 2 files changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ _UseCrab ()
23
23
" " )
24
24
case " $cur " in
25
25
" " )
26
- 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 ) )
26
+ COMPREPLY=( $( compgen -W ' --version --help -h --quiet --debug checkdataset checkfile checkusername checkwrite createmyproxy getlog getoutput getsandbox kill preparelocal proceed recover remake report resubmit setdatasetstatus setfilestatus status submit tasks uploadlog' -- $cur ) )
27
27
;;
28
28
-* )
29
29
COMPREPLY=( $( compgen -W ' --version --help -h --quiet --debug' -- $cur ) )
30
30
;;
31
31
* )
32
- 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 ) )
32
+ COMPREPLY=( $( compgen -W ' checkdataset checkfile checkusername checkwrite createmyproxy getlog getoutput getsandbox kill preparelocal proceed recover remake report resubmit setdatasetstatus setfilestatus status submit tasks uploadlog' -- $cur ) )
33
33
;;
34
34
esac
35
35
;;
@@ -355,10 +355,10 @@ _UseCrab ()
355
355
;;
356
356
357
357
* )
358
- 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 ) )
358
+ COMPREPLY=( $( compgen -W ' checkdataset checkfile checkusername checkwrite createmyproxy getlog getoutput getsandbox kill preparelocal proceed recover remake report resubmit setdatasetstatus setfilestatus status submit tasks uploadlog' -- $cur ) )
359
359
;;
360
360
esac
361
361
362
362
return 0
363
363
}
364
- complete -F _UseCrab -o filenames -o nosort crab
364
+ complete -F _UseCrab -o filenames crab
Original file line number Diff line number Diff line change 34
34
35
35
logging .basicConfig (level = logging .INFO )
36
36
37
+ ######################################################
38
+ # Make sure that 'complete` command in template below meet following rules
39
+ # - Starts with: complete\s+-F\s+<crab-function-name>\s+
40
+ # - Ends with: \s+crab
41
+ # Otherwise suggest changes in crab-build.file in cms-sw/cmsdist repository
42
+ #####################################################
43
+
37
44
template = """
38
45
_UseCrab ()
39
46
{{
77
84
78
85
return 0
79
86
}}
80
- complete -F _UseCrab -o filenames -o nosort crab
87
+ complete -F _UseCrab -o filenames crab
81
88
"""
82
89
83
90
template_cmd = """
@@ -155,23 +162,6 @@ def __init__(self):
155
162
cmdflags = ' ' .join (flags ),
156
163
cmdoptions = ' ' .join (opts ))
157
164
158
-
159
- # sort the output of "crab <tab> <tab>"
160
- # the higher the number the earlier a crab command is shown
161
- weights = {
162
- "status" : 1000 ,
163
- "tasks" : 200 ,
164
- "submit" : 110 ,
165
- "proceed" : 100 ,
166
- }
167
- # current sorting as of 2024-05-14. Do we still want to keep this?
168
- #checkwrite getlog checkusername checkdataset checkfile
169
- #submit getoutput resubmit kill uploadlog
170
- #remake report preparelocal createmyproxy setdatasetstatus setfilestatus
171
-
172
- longnames_w = [(name , weights [name ] if name in weights else 0 ) for name in longnames ]
173
- longnames_w = sorted (longnames_w , key = lambda x : x [1 ], reverse = True )
174
- longnames = [l_w [0 ] for l_w in longnames_w ]
175
165
logging .info (longnames )
176
166
177
167
with open (p_args .output_file , "w" , encoding = "utf-8" ) as f_ :
You can’t perform that action at this time.
0 commit comments