~ubuntu-branches/ubuntu/karmic/zsh/karmic

« back to all changes in this revision

Viewing changes to Completion/Base/Utility/_arguments

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-06-02 10:40:25 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090602104025-lg6wynxpzqi08k2i
Tags: 4.3.10-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  + debian/zshrc: Enable completions by default, unless
    skip_global_compinit is set

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
local long cmd="$words[1]" descr odescr mesg subopts opt opt2 usecc autod
7
7
local oldcontext="$curcontext" hasopts rawret optarg singopt alwopt
8
 
local setnormarg
 
8
local setnormarg start rest
9
9
local -a match mbegin mend
10
10
 
11
11
long=$argv[(I)--]
97
97
       # present.  Maybe the problem was that the intervening code
98
98
       # didn't.  If it's buggy without removing them, the problem
99
99
       # probably is later, not here.
100
 
       if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9_-]#}]} ]]; then
101
 
         tmp+=($match[1])
 
100
       start=${match[1]}
 
101
       rest=${match[2]}
 
102
       if [[ -z ${tmp[(r)${start%%[^a-zA-Z0-9_-]#}]} ]]; then
 
103
         # variant syntax seen in fetchmail:
 
104
         # --[fetch]all  means --fetchall or --all.
 
105
         # maybe needs to be more general
 
106
         if [[ $start = (#b)(*)\[(*)\](*) ]]; then
 
107
           tmp+=("${match[1]}${match[2]}${match[3]}" "${match[1]}${match[3]}")
 
108
         else
 
109
           tmp+=($start)
 
110
         fi
102
111
       fi
103
 
       opt=$match[2]
 
112
       opt=$rest
104
113
     done
105
114
     # If there's left over text, assume it's a description; it
106
115
     # may be truncated but if it's too long it's no use anyway.