- package App::smsg::Command::Chain;
- use 5.010;
- use strict;
- use warnings;
- use utf8;
- BEGIN {
- $App::smsg::Command::Chain::AUTHORITY = 'https://dr.jones.dk/me#me';
- $App::smsg::Command::Chain::VERSION = '0.001';
- }
- use App::smsg -command;
- use namespace::clean;
- use constant abstract => q (Handle chains of (varying delayed) responses.);
- use constant usage_desc => '%c chain %o <action> [<chain>...]';
- use constant description => <<'DESCRIPTION';
- Compose, monitor or interact with chains of responses.
- Composition actions: create, join, drop, content, list.
- Monitoring actions: follow.
- Keep connection open and emit each change of state.
- Interactive actions: begin, pause, continue, cancel, status.
- Each target can connect to one chain at a time, i.e. begin implies drop.
- When chain or an option is needed but not provided, it is attempted
- resolved from previous related communication, then from defaults, and
- then interactively prompted for.
- DESCRIPTION
- use constant opt_spec => (
- ['target|to=s', "Recipient ID"],
- ['origin|from=s', "Faked sender ID"],
- ['platform|on=s', "Platform to operate on. Either generic (chat, sms, microblog) or specific (kannel, jabber, irc, twitter, status.net)."],
- ['intermediary|via=s', "Message center, host or net to use in case of multiple routes"],
- [],
- # [ 'verbose|v', "print extra stuff"],
- [ 'debug', "print debug stuff"],
- );
- sub validate_args {
- my ($self, $opt, $args) = @_;
- $self->usage_error("too few arguments") unless @$args >= 1;
- }
- sub execute {
- my ($self, $opt, $args) = @_;
- # TODO: error if pause and no active chain
- # TODO: error if continue and no paused chain
- die 'FIXME: unimplemented!';
- }
- 1;
|