~ubuntu-branches/ubuntu/vivid/bash-completion/vivid-proposed

« back to all changes in this revision

Viewing changes to contrib/rcs

  • Committer: Package Import Robot
  • Author(s): Angel Abad
  • Date: 2011-02-08 09:39:13 UTC
  • mfrom: (5.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20110208093913-89h9hx9eq5j7vjpw
Tags: 1:1.3-1ubuntu1
* Merge from debian unstable. (LP: #715057) Remaining changes:
  - debian/patches/disable-avahi-browse.diff: Disable avahi-browse since
    it scales poorly in the current form:
    + Refresh patch
  - debian/patches/apt-get-changelog.patch:
    + Re-work patch because contrib dir no longer exists in upstream
      distribution.
* Dropped chages, applied upstream:
  - Fix p4 completion
  - Fix typo in openssl completion
  - Fix error while loading service(8) completions

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# bash completion for rcs
2
 
 
3
 
have rcs &&
4
 
_rcs()
5
 
{
6
 
    local cur prev file dir i
7
 
 
8
 
    COMPREPLY=()
9
 
    _get_comp_words_by_ref cur prev
10
 
 
11
 
    file=${cur##*/}
12
 
    dir=${cur%/*}
13
 
 
14
 
    # deal with relative directory
15
 
    [ "$file" = "$dir" ] && dir=.
16
 
 
17
 
    COMPREPLY=( $( compgen -f "$dir/RCS/$file" ) )
18
 
 
19
 
    for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
20
 
        file=${COMPREPLY[$i]##*/}
21
 
        dir=${COMPREPLY[$i]%RCS/*}
22
 
        COMPREPLY[$i]=$dir$file
23
 
    done
24
 
 
25
 
    COMPREPLY=( "${COMPREPLY[@]}" $( compgen -G "$dir/$file*,v" ) )
26
 
 
27
 
    for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do
28
 
        COMPREPLY[$i]=${COMPREPLY[$i]%,v}
29
 
    done
30
 
 
31
 
    # default to files if nothing returned and we're checking in.
32
 
    # otherwise, default to directories
33
 
    [[ ${#COMPREPLY[@]} -eq 0 && $1 == ci ]] && _filedir || _filedir -d
34
 
} &&
35
 
complete -F _rcs -o filenames ci co rlog rcs rcsdiff
36
 
 
37
 
# Local variables:
38
 
# mode: shell-script
39
 
# sh-basic-offset: 4
40
 
# sh-indent-comment: t
41
 
# indent-tabs-mode: nil
42
 
# End:
43
 
# ex: ts=4 sw=4 et filetype=sh