Changeset dab89e28


Ignore:
Timestamp:
Nov 20, 2009, 3:28:56 AM (15 years ago)
Author:
Alex Dehnert <adehnert@mit.edu>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e8074ed
Parents:
1b9a163
git-author:
Alex Dehnert <adehnert@mit.edu> (10/27/09 17:44:44)
git-committer:
Alex Dehnert <adehnert@mit.edu> (11/20/09 03:28:56)
Message:
Add completion for :filter*
File:
1 edited

Legend:

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

    r02a72bf rdab89e28  
    9898}
    9999
     100sub complete_filter_no_flags
     101{
     102    my $ctx = shift;
     103    # Syntax: filter FILTERNAME EXPR
     104
     105    # FILTERNAME
     106    return complete_filter_name() if $ctx->word == 1;
     107
     108    $ctx = $ctx->shift_words(2);
     109    return complete_filter_expr($ctx);
     110}
     111
     112sub complete_filter_append {
     113    my $ctx = shift;
     114    # Syntax: filterappend FILTERNAME EXPR
     115
     116    # FILTERNAME
     117    return complete_filter_name() if $ctx->word == 1;
     118    return qw(and or) if $ctx->word == 2;
     119    $ctx = $ctx->shift_words(3);
     120    return complete_filter_expr($ctx);
     121}
     122
    100123sub complete_view {
    101124    my $ctx = shift;
     
    146169BarnOwl::Completion::register_completer(help    => \&complete_help);
    147170BarnOwl::Completion::register_completer(filter  => \&complete_filter);
     171BarnOwl::Completion::register_completer(filteror        => \&complete_filter_no_flags);
     172BarnOwl::Completion::register_completer(filterand       => \&complete_filter_no_flags);
     173BarnOwl::Completion::register_completer(filterappend    => \&complete_filter_append);
    148174BarnOwl::Completion::register_completer(view    => \&complete_view);
    149175BarnOwl::Completion::register_completer(show    => \&complete_show);
Note: See TracChangeset for help on using the changeset viewer.