Changeset d4ecc78 for perl


Ignore:
Timestamp:
Jul 28, 2009, 10:57:51 PM (15 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
3b80321
Parents:
7cd5878
git-author:
David Benjamin <davidben@mit.edu> (07/28/09 22:36:01)
git-committer:
David Benjamin <davidben@mit.edu> (07/28/09 22:57:51)
Message:
Complete color names for filters

This will likely have to be changed later, but for now, it's something.

Signed-off-by: David Benjamin <davidben@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Complete/Client.pm

    rf80ada8 rd4ecc78  
    88use BarnOwl::Completion::Util qw(complete_flags);
    99
     10my @all_colors = qw(default
     11                    black
     12                    blue
     13                    cyan
     14                    green
     15                    magenta
     16                    red
     17                    white
     18                    yellow);
     19
    1020sub complete_command { return sort @BarnOwl::all_commands; }
     21sub complete_color { return @all_colors; }
    1122
    1223sub complete_help {
     
    2031}
    2132
    22 BarnOwl::Completion::register_completer(help      => \&complete_help);
     33sub complete_filter {
     34    my $ctx = shift;
     35    return complete_flags($ctx,
     36        [qw()],
     37        {
     38           "-c" => \&complete_color,
     39           "-b" => \&complete_color,
     40        },
     41        undef # TODO: make this get list of filters for the first argument
     42              # then maybe some magic like completing keywords instance and other shiny
     43        );
     44}
     45
     46BarnOwl::Completion::register_completer(help    => \&complete_help);
     47BarnOwl::Completion::register_completer(filter  => \&complete_filter);
    2348
    24491;
Note: See TracChangeset for help on using the changeset viewer.