This file is indexed.

/etc/bash_completion.d/rivet-completion is in rivet 1.8.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
## -*- sh -*-
## Analysis name completion for rivet scripts

(type _filedir &> /dev/null) || \
function _filedir() {
    local cur prev commands options command
    cur="${COMP_WORDS[COMP_CWORD]}"
    COMPREPLY=( $(compgen -W "$(ls ${cur}* 2> /dev/null)" -- ${cur}) )
    return 0
}


function _rivet() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help --verbose --quiet --version --nevts --cross-section"
    opts="$opts --analysis --runname --list-analyses --show-analysis"
    opts="$opts --analysis-path --analysis-path-append --pwd"
    opts="$opts --histo-file --histo-interval --event-timeout"
    opts="$opts -a -A -n -h -x -H -l -v -q"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    if test -x "$(which rivet 2> /dev/null)"; then
        anas=$(rivet --list-analyses)
        if (echo ${prev} | egrep -- "\<-a\>|\<--analysis\>|\<--show-analysis\>|\<--list-analyses\>" &> /dev/null); then
            COMPREPLY=( $(compgen -W "$anas" -- ${cur}) )
            return 0
        fi
    fi

    if (echo ${prev} | egrep -- "\<-n\>|\<--nevts\>|\<--runname\>|\<--histo-interval\>|\<--cross-section\>|\<-x\>|\<--event-timeout\>" &> /dev/null); then
        COMPREPLY=()
        return 0
    fi

    if (echo ${prev} | egrep -- "\<--histo-file\>|\<-H\>" &> /dev/null); then
        _filedir aida
        return 0
    fi

    if (echo ${prev} | egrep -- "\<--analysis-path\>|\<--analysis-path-append\>" &> /dev/null); then
        _filedir -d
        return 0
    fi

    _filedir
    return 0
}


complete -F _rivet rivet


##########################


function _rivet_config() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help --version"
    opts="$opts --prefix --includedir --libdir --datadir"
    opts="$opts --pythonpath --cppflags --ldflags --libs"
    opts="$opts -h"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    COMPREPLY=( $(compgen -W "$opts" -- ${cur}) )
    if test -n "$COMPREPLY"; then
        return 0
    fi

    return 0
}


complete -F _rivet_config rivet-config


##############################


function _compare_histos() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help -h"
    opts="$opts --outdir -o"
    opts="$opts --rivet-refs -R --no-rivet-refs"
    opts="$opts --histogram-list -l"
    opts="$opts --hier-out --linear --logarithmic --mc-errs"
    opts="$opts --no-ratio --rel-ratio --abs-ratio"
    opts="$opts --all --show-mc-only --show-single --refid"
    opts="$opts --no-plottitle"
    opts="$opts --plotinfodir"
    opts="$opts --no-rmgapbins"
    opts="$opts --quiet -q --verbose -v"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    if [[ ${prev} == "--plotinfodir" ]] ; then
        _filedir -d
        return 0
    fi

    if [[ ${prev} == "--show-single" ]]; then
        COMPREPLY=( $(compgen -W "no mc ref all" -- ${cur}) )
        return 0
    fi

    _filedir aida
    return 0
}


complete -F _compare_histos -o default compare-histos


##############################


function _make_plots() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help -h"
    opts="$opts --num-threads -n"
    opts="$opts --palatino --cm --times --minion"
    opts="$opts --ps --pdf --eps --png --pdfpng --pspng"
    opts="$opts --tex --no-cleanup --full-range"
    opts="$opts --config -c"
    opts="$opts --quiet -q --verbose -v"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    _filedir dat
    return 0
}


complete -F _make_plots -o default make-plots


########################


function _rivet_mkhtml() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help -h"
    opts="$opts --outputdir -o"
    opts="$opts --title -t"
    opts="$opts --config -c"
    opts="$opts --single -s"
    opts="$opts --no-ratio --mc-errs --refid"
    opts="$opts --num-threads --n"
    opts="$opts --pdf --ps --booklet"
    opts="$opts --ignore-unvalidated -i"
    opts="$opts --match -m"
    opts="$opts --unmatch -M"
    opts="$opts --verbose -v"
    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    ## Options with files / directories as the arg
    if (echo ${prev} | egrep -- "\<--outputdir\>|\<-o\>" &> /dev/null); then
        _filedir -d
        return 0
    fi
    if (echo ${prev} | egrep -- "\<--config\>|\<-c\>" &> /dev/null); then
        _filedir
        return 0
    fi

    ## Options without an completeable arg
    if (echo ${prev} | egrep -- "\<-t\>|\<--title\>|\<--refid\>|\<--n\>|\<--num-threads\>|\<-m\>|\<--match\>|\<-M\>|\<--unmatch\>" &> /dev/null); then
        COMPREPLY=()
        return 0
    fi

    _filedir aida
    return 0
}


complete -F _rivet_mkhtml rivet-mkhtml


##############################


function _aida2flat() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help -h"
    opts="$opts --split -s"
    opts="$opts --gnuplot -g"
    opts="$opts --plotinfodir"
    opts="$opts --smart-output -S"
    opts="$opts --match -m"
    opts="$opts --quiet -q --verbose -v"

    if [[ ${cur} == "--plotinfodir" ]] ; then
        _filedir -d
        return 0
    fi

    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    _filedir aida
    return 0
}


complete -F _aida2flat -o default aida2flat


##############################


function _flat2aida() {
    local cur prev commands options command
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    opts="--help -h"
    opts="$opts --split -s"

    if [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        if test -n "$COMPREPLY"; then
            return 0
        fi
    fi

    _filedir dat
    return 0
}


complete -F _aida2flat -o default aida2flat