diff options
author | Jonas Smedegaard <jonas@atreju.jones.dk> | 2012-10-12 00:58:57 +0200 |
---|---|---|
committer | Jonas Smedegaard <jonas@atreju.jones.dk> | 2012-10-12 00:58:57 +0200 |
commit | 086a44af71491ba7845c54bfca786d562e1ccb66 (patch) | |
tree | a7b51d1592ffc3d8087c9a4fc4b82c447d650087 /lib | |
parent | e102baef1e60c6ee866ebf6e817490935fdd703a (diff) |
Add draft plugins.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/smsg/Command/Chain.pm | 58 | ||||
-rw-r--r-- | lib/App/smsg/Command/Group.pm | 51 | ||||
-rw-r--r-- | lib/App/smsg/Command/Status.pm | 2 |
3 files changed, 111 insertions, 0 deletions
diff --git a/lib/App/smsg/Command/Chain.pm b/lib/App/smsg/Command/Chain.pm new file mode 100644 index 0000000..90dc24f --- /dev/null +++ b/lib/App/smsg/Command/Chain.pm @@ -0,0 +1,58 @@ +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"], + ['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; diff --git a/lib/App/smsg/Command/Group.pm b/lib/App/smsg/Command/Group.pm new file mode 100644 index 0000000..b1c4481 --- /dev/null +++ b/lib/App/smsg/Command/Group.pm @@ -0,0 +1,51 @@ +package App::smsg::Command::Group; + +use 5.010; +use strict; +use warnings; +use utf8; + +BEGIN { + $App::smsg::Command::Group::AUTHORITY = 'https://dr.jones.dk/me#me'; + $App::smsg::Command::Group::VERSION = '0.001'; +} + +use App::smsg -command; +use namespace::clean; + +use constant abstract => q (Handle groups of recipients.); +use constant usage_desc => '%c group %o <action> [<group>...]'; +use constant description => <<'DESCRIPTION'; +Compose, monitor or interact with groups of message recipients. + +Composition action is one of create, join, drop, content or list. + +Monitoring actions: follow. +Keep connection open and emit change of state, i.e. each use, number of +pending recipients, and when done. + +Interactive action is one of cancel or status. + +When group 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 => ( +# [ '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) = @_; + + die 'FIXME: unimplemented!'; + +} + +1; diff --git a/lib/App/smsg/Command/Status.pm b/lib/App/smsg/Command/Status.pm index 019cd5b..f0dfb70 100644 --- a/lib/App/smsg/Command/Status.pm +++ b/lib/App/smsg/Command/Status.pm @@ -33,6 +33,8 @@ use constant opt_spec => ( {default => 'foobar'}], ['kannelsmsc=s', "the Kannel SMSC to correspond with"], [], + ['f|follow', "keep connection open and emit each change of state"], + [], # [ 'verbose|v', "print extra stuff"], [ 'debug', "print debug stuff"], ); |