Changeset 28cf94b for perl/lib/BarnOwl


Ignore:
Timestamp:
Aug 1, 2009, 9:22:59 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:
7940ac2
Parents:
2fa9a1a0
git-author:
David Benjamin <davidben@mit.edu> (08/01/09 16:29:43)
git-committer:
David Benjamin <davidben@mit.edu> (08/01/09 21:22:59)
Message:
Add completions for getvar and set

Pending implementation of complete_variable, but for now set knows to
complete the -q flag. (Tested by hardcoding dummy listed into
complete_variable).

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

Legend:

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

    r1610e5b r28cf94b  
    8686}
    8787
     88sub complete_getvar {
     89    my $ctx = shift;
     90    return unless ($ctx->word == 1);
     91    return complete_variable();
     92}
     93
     94sub complete_set {
     95    my $ctx = shift;
     96    return complete_flags($ctx,
     97        [qw(-q)],
     98        {
     99        },
     100         \&complete_set_args
     101        );
     102}
     103sub complete_set_args {
     104    my $ctx = shift;
     105    my $arg = shift;
     106    return if $arg;
     107    return complete_variable();
     108}
     109
    88110BarnOwl::Completion::register_completer(help    => \&complete_help);
    89111BarnOwl::Completion::register_completer(filter  => \&complete_filter);
    90112BarnOwl::Completion::register_completer(show    => \&complete_show);
     113BarnOwl::Completion::register_completer(getvar  => \&complete_getvar);
     114BarnOwl::Completion::register_completer(set     => \&complete_set);
    91115
    921161;
Note: See TracChangeset for help on using the changeset viewer.