Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 - 1
# bash completion for yum-utils
2
 
3
# repomanage
4
_yu_repomanage()
5
{
6
    COMPREPLY=()
7
 
8
    case "$3" in
9
        -h|--help)
10
            return 0
11
            ;;
12
        -k|--keep)
13
            COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$2" ) )
14
            return 0
15
            ;;
16
    esac
17
 
18
    if [[ "$2" == -* ]] ; then
19
        COMPREPLY=( $( compgen -W '--old --new --space --keep --nocheck
20
            --help' -- "$2" ) )
21
        return 0
22
    fi
23
 
24
    COMPREPLY=( $( compgen -d -- "$2" ) )
25
} &&
26
complete -F _yu_repomanage -o filenames repomanage repomanage.py
27
 
28
# package-cleanup
29
_yu_package_cleanup()
30
{
31
    COMPREPLY=()
32
 
33
    _yum_complete_baseopts "$2" "$3" 2>/dev/null && return 0
34
 
35
    case "$3" in
36
        --leaf-regex|--qf|--queryformat)
37
            return 0
38
            ;;
39
        --count)
40
            COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$2" ) )
41
            return 0
42
            ;;
43
    esac
44
 
45
    COMPREPLY=( $( compgen -W '$( _yum_baseopts 2>/dev/null ) --problems
46
        --queryformat --orphans --dupes --cleandupes --noscripts --leaves --all
47
        --leaf-regex --exclude-devel --exclude-bin --oldkernels --count
48
        --keepdevel' -- "$2" ) )
49
} &&
50
complete -F _yu_package_cleanup -o filenames package-cleanup package-cleanup.py
51
 
52
# verifytree
53
_yu_verifytree()
54
{
55
    COMPREPLY=()
56
 
57
    case "$3" in
58
        -h|--help|-t|--testopia)
59
            return 0
60
            ;;
61
    esac
62
 
63
    if [[ "$2" == -* ]] ; then
64
        COMPREPLY=( $( compgen -W '--help --checkall --testopia --treeinfo' \
65
            -- "$2" ) )
66
        return 0
67
    fi
68
 
69
    COMPREPLY=( $( compgen -d -- "$2" ) )
70
} &&
71
complete -F _yu_verifytree -o filenames verifytree verifytree.py
72
 
73
# repo-graph
74
_yu_repo_graph()
75
{
76
    COMPREPLY=()
77
 
78
    case "$3" in
79
        -h|--help)
80
            return 0
81
            ;;
82
        --repoid)
83
            _yum_repolist all "$2" 2>/dev/null
84
            return 0
85
            ;;
86
        -c)
87
            COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$2" ) )
88
            return 0
89
            ;;
90
    esac
91
 
92
    COMPREPLY=( $( compgen -W '--help --repoid -c' -- "$2" ) )
93
} &&
94
complete -F _yu_repo_graph -o filenames repo-graph repo-graph.py
95
 
96
# repo-rss
97
_yu_repo_rss()
98
{
99
    COMPREPLY=()
100
 
101
    case "$3" in
102
        -h|--help|-l|-t|-d|-r|-a)
103
            return 0
104
            ;;
105
        -f)
106
            COMPREPLY=( $( compgen -f -o plusdirs -X '!*.xml' -- "$2" ) )
107
            return 0
108
            ;;
109
        -c)
110
            COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$2" ) )
111
            return 0
112
            ;;
113
    esac
114
 
115
    COMPREPLY=( $( compgen -W '--help -f -l -t -d -r --tempcache -g -a -c' \
116
        -- "$2" ) )
117
    [[ "$2" == -* ]] || _yum_repolist all "$2" 2>/dev/null || return 0
118
} &&
119
complete -F _yu_repo_rss -o filenames repo-rss repo-rss.py
120
 
121
# repoclosure
122
_yu_repoclosure()
123
{
124
    COMPREPLY=()
125
 
126
    case "$3" in
127
        -h|--help|-a|--arch|--basearch|--repofrompath)
128
            return 0
129
            ;;
130
        -c|--config)
131
            COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$2" ) )
132
            return 0
133
            ;;
134
        -l|--lookaside|-r|--repoid)
135
            _yum_repolist all "$2" 2>/dev/null
136
            return 0
137
            ;;
138
        -p|--pkg)
139
            _yum_list all "$2" 2>/dev/null
140
            return 0
141
            ;;
142
        -g|--group)
143
            _yum_grouplist "" "$2" 2>/dev/null
144
            return 0
145
            ;;
146
    esac
147
 
148
    COMPREPLY=( $( compgen -W '--help --config --arch --basearch --builddeps
149
        --lookaside --repoid --tempcache --quiet --newest --repofrompath --pkg
150
        --group' -- "$2" ) )
151
} &&
152
complete -F _yu_repoclosure -o filenames repoclosure repoclosure.py
153
 
154
# repoquery
155
_yu_repoquery()
156
{
157
    COMPREPLY=()
158
 
159
    local groupmode=false
160
    for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
161
        case "${COMP_WORDS[i]}" in -g|--group) groupmode=true ; break ;; esac
162
    done
163
 
164
    case "$3" in
165
        -h|--help|--version|-f|--file|--qf|--queryformat|--resolve|--archlist|\
166
        --whatprovides|--whatrequires|--whatobsoletes|--whatconflicts|\
167
        --repofrompath)
168
            return 0
169
            ;;
170
        -l|--list|-i|--info|-R|--requires)
171
            if $groupmode ; then
172
                _yum_grouplist "" "$2" 2>/dev/null
173
            else
174
                _yum_list all "$2" 2>/dev/null
175
            fi
176
            return 0
177
            ;;
178
        --provides|--obsoletes|--conflicts|--groupmember|--changelog|\
179
        --location|--nevra|--envra|--nvr|-s|--source)
180
            _yum_list all "$2" 2>/dev/null
181
            return 0
182
            ;;
183
        --grouppkgs)
184
            COMPREPLY=( $( compgen -W 'all default optional mandatory' \
185
                -- "$2" ) )
186
            return 0
187
            ;;
188
        --pkgnarrow)
189
            COMPREPLY=( $( compgen -W 'all available updates installed extras
190
                obsoletes recent repos' -- "$2" ) )
191
            return 0
192
            ;;
193
        --repoid)
194
            _yum_repolist all "$2" 2>/dev/null
195
            return 0
196
            ;;
197
        --enablerepo)
198
            _yum_repolist disabled "$2" 2>/dev/null
199
            return 0
200
            ;;
201
        --disablerepo)
202
            _yum_repolist enabled "$2" 2>/dev/null
203
            return 0
204
            ;;
205
        -c)
206
            COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$2" ) )
207
            return 0
208
            ;;
209
    esac
210
 
211
    COMPREPLY=( $( compgen -W '--version --help --list --info --file
212
        --queryformat --groupmember --all --requires --provides --obsoletes
213
        --conflicts --changelog --location --nevra --envra --nvr --source
214
        --srpm --resolve --exactdeps --recursive --whatprovides --whatrequires
215
        --whatobsoletes --whatconflicts --group --grouppkgs --archlist
216
        --pkgnarrow --installed --show-duplicates --repoid --enablerepo
217
        --disablerepo --repofrompath --plugins --quiet --verbose --cache
218
        --tempcache --querytags --config --tree-requires --tree-conflicts
219
        --tree-obsoletes --tree-whatrequires' -- "$2" ) )
220
} &&
221
complete -F _yu_repoquery -o filenames repoquery repoquery.py
222
 
223
# yumdb
224
_yu_yumdb()
225
{
226
    COMPREPLY=()
227
 
228
    case "$3" in
229
        -h|--help|-version)
230
            return 0
231
            ;;
232
        -c|--config)
233
            COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$2" ) )
234
            return 0
235
            ;;
236
        shell)
237
            COMPREPLY=( $( compgen -f -o plusdirs -- "$2" ) )
238
            return 0
239
            ;;
240
    esac
241
 
242
    if [ $COMP_CWORD -le 1 ] ; then
243
        COMPREPLY=( $( compgen -W 'get set del rename rename-force copy search
244
            exist unset info shell --version --help --noplugins --config' \
245
                -- "$2" ) )
246
    fi
247
} &&
248
complete -F _yu_yumdb -o filenames yumdb yumdb.py
249
 
250
# repodiff
251
_yu_repodiff()
252
{
253
    COMPREPLY=()
254
 
255
    case "$3" in
256
        -h|--help|--version|-n|--new|-o|--old|-a|--archlist)
257
            return 0
258
            ;;
259
    esac
260
 
261
    COMPREPLY=( $( compgen -W '--version --help --new --old --quiet --archlist
262
        --size --simple' -- "$2" ) )
263
} &&
264
complete -F _yu_repodiff repodiff repodiff.py
265
 
266
# yum-builddep
267
_yu_builddep()
268
{
269
    COMPREPLY=()
270
 
271
    _yum_complete_baseopts "$2" "$3" && return 0
272
 
273
    if [[ $2 == -* ]] ; then
274
        COMPREPLY=( $( compgen -W '$( _yum_baseopts 2>/dev/null )' -- "$2" ) )
275
        return 0
276
    fi
277
 
278
    COMPREPLY=( $( compgen -f -o plusdirs -X "!*.spec" -- "$2" ) )
279
    [[ $2 != */* && $2 != ~* ]] && _yum_list all "$2" 2>/dev/null
280
} &&
281
complete -F _yu_builddep -o filenames yum-builddep yum-builddep.py
282
 
283
# debuginfo-install
284
_yu_debuginfo_install()
285
{
286
    COMPREPLY=()
287
 
288
    _yum_complete_baseopts "$2" "$3" && return 0
289
 
290
    if [[ $2 == -* ]] ; then
291
        COMPREPLY=( $( compgen -W '$( _yum_baseopts 2>/dev/null )
292
            --no-debuginfo-plugin' -- "$2" ) )
293
        return 0
294
    fi
295
 
296
    _yum_list all "$2"
297
} &&
298
complete -F _yu_debuginfo_install debuginfo-install debuginfo-install.py
299
 
300
# Local variables:
301
# mode: shell-script
302
# sh-basic-offset: 4
303
# sh-indent-comment: t
304
# indent-tabs-mode: nil
305
# End:
306
# ex: ts=4 sw=4 et filetype=sh