Changeset 76e0e4a for perl/lib/BarnOwl/Complete/Client.pm
- Timestamp:
- Sep 30, 2009, 1:02:36 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 6035008
- Parents:
- b06a888
- git-author:
- David Benjamin <davidben@mit.edu> (09/23/09 00:34:20)
- git-committer:
- David Benjamin <davidben@mit.edu> (09/30/09 01:02:36)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Complete/Client.pm
rb06a888 r76e0e4a 161 161 } 162 162 163 sub complete_filter_args {164 my $ctx = shift;165 my $arg = shift;166 return complete_filter_name() unless $arg;167 my $idx = 2; # skip the filter name168 while ($idx < $ctx->word) {169 last unless ($ctx->words->[$idx] =~ m{^-});170 $idx += 2; # skip the flag and the argument171 }172 return complete_filter_expr($ctx, $idx);173 }174 175 163 sub complete_help { 176 164 my $ctx = shift; … … 194 182 sub complete_filter { 195 183 my $ctx = shift; 184 # Syntax: filter FILTERNAME FLAGS EXPR 185 186 # FILTERNAME 187 return complete_filter_name() if $ctx->word == 1; 188 189 # FLAGS 190 $ctx = $ctx->shift_words(1); # complete_flags starts at the second word 196 191 return complete_flags($ctx, 197 192 [qw()], … … 200 195 "-b" => \&complete_color, 201 196 }, 202 \&complete_filter_args 197 # EXPR 198 sub { 199 my $ctx = shift; 200 my $arg = shift; 201 202 # We pass stop_at_nonflag, so we can rewind to the start 203 my $idx = $ctx->word - $arg; 204 return complete_filter_expr($ctx, $idx); 205 }, 206 stop_at_nonflag => 1 203 207 ); 204 208 }
Note: See TracChangeset
for help on using the changeset viewer.