- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl/Completion/Util.pm
r69c27e6 r94ef58c 24 24 my $optsdone = 0; 25 25 26 my %flags_seen;27 28 26 while($idx < $ctx->word) { 29 27 my $word = $ctx->words->[$idx]; … … 39 37 } elsif ($word =~ m{^-}) { 40 38 $word = "-" . substr($word, -1); 41 $flags_seen{$word} = 1; # record flag42 39 $flag = $word if(exists $args->{$word}); 43 40 } else { … … 61 58 return; 62 59 } else { 63 my @opts = $optsdone ? () : (@$no_args, keys %$args); 64 # filter out flags we've seen if needbe 65 @opts = grep {!$flags_seen{$_}} @opts unless $options{repeat_flags}; 66 return (@opts, $default ? ($default->($ctx, $argct)) : ()); 60 return ($optsdone ? () : (@$no_args, keys %$args), 61 $default ? ($default->($ctx, $argct)) : ()); 67 62 } 68 63 }
Note: See TracChangeset
for help on using the changeset viewer.