Changeset 4fbc7f5 for perl/lib


Ignore:
Timestamp:
Jul 29, 2009, 9:41:44 PM (12 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
747d6a5
Parents:
e711ca7
git-author:
Nelson Elhage <nelhage@mit.edu> (07/29/09 21:30:43)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/29/09 21:41:44)
Message:
complete_flags: Pass the completer the argument number being completed

This is the index of the argument (not flag or flag option) being
completed, for convenience.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Completion/Util.pm

    re711ca7 r4fbc7f5  
    1919    my $flag = undef;
    2020
    21     my $word = 0;
     21    my $argct = 0;
    2222    my $optsdone = 0;
    2323
     
    3535            $word = "-" . substr($word, -1);
    3636            $flag = $word if(exists $args->{$word});
     37        } else {
     38            $argct++;
    3739        }
    3840        $idx++;
     
    4749    } else {
    4850        return ($optsdone ? () : (@$no_args, keys %$args),
    49                 $default ? ($default->($ctx)) : ());
     51                $default ? ($default->($ctx, $argct)) : ());
    5052    }
    5153}
Note: See TracChangeset for help on using the changeset viewer.