Umph::Prompt(3p)

NAME
Umph::Prompt - Interactive prompt for Umph

SYNOPSIS
  my @items;
  push @items, {title => 'foo', url => 'http://foo', selected => 0};
  push @items, {title => 'bar', url => 'http://bar', selected => 0};

  my $p = new Umph::Prompt(

    # Commands.
    commands => {
      q => sub {
        my ($p, $args) = @_;
        $p->exit(\@items, $args);
      },
      d => sub {
        my ($p, $args) = @_;
        $p->display(\@items, $args);
      },
      m => sub {
        my ($p, $args) = @_;
        $p->max_shown_items(@{$args});
      },
      s => sub {
        my ($p, $args) = @_;
        $p->select(\@items, $args);
      },
      h => sub {
        my ($p, $args) = @_;
        $p->help($args);
      },
    },

    # Callbacks. All of these are optional.
    ontoggle => sub {
      my ($p, $args) = @_;
      $p->toggle(\@items, $args);
    },
    onloaded => sub {
      my ($p, $args) = @_;
      $p->display(\@items, $args);
    },
    onitems => sub {return \@items},

    # Other (required) settings
    total_items     => scalar @items,
    prompt_msg      => 'foo',
    max_shown_items => 20
  );

  $p->exec;

DESCRIPTION
Umph::Prompt is an interactive prompt module for umph and similar programs.

  EXPORT
None by default.

SEE ALSO
  gitweb: <http://repo.or.cz/w/umph-prompt.git>

AUTHOR
Toni Gundogdu <legatvs at sign cpan org<gt>

LICENSE
Umph::Prompt is free software, licensed under the LGPLv2.1+.