From 2b5deac2609d3479eabb7acb05b40875a6a9161d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 12 Oct 2012 01:21:13 +0200 Subject: Add draft send plugin, and add option origin to chain plugin. --- lib/App/smsg/Command/Chain.pm | 1 + lib/App/smsg/Command/Send.pm | 52 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/App/smsg/Command/Send.pm diff --git a/lib/App/smsg/Command/Chain.pm b/lib/App/smsg/Command/Chain.pm index 90dc24f..5c1c6e5 100644 --- a/lib/App/smsg/Command/Chain.pm +++ b/lib/App/smsg/Command/Chain.pm @@ -32,6 +32,7 @@ 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"], [], diff --git a/lib/App/smsg/Command/Send.pm b/lib/App/smsg/Command/Send.pm new file mode 100644 index 0000000..facbde5 --- /dev/null +++ b/lib/App/smsg/Command/Send.pm @@ -0,0 +1,52 @@ +package App::smsg::Command::Send; + +use 5.010; +use strict; +use warnings; +use utf8; + +BEGIN { + $App::smsg::Command::Send::AUTHORITY = 'https://dr.jones.dk/me#me'; + $App::smsg::Command::Send::VERSION = '0.001'; +} + +use App::smsg -command; +use namespace::clean; + +use constant abstract => q (Send a message to one or more recipients.); +use constant usage_desc => '%c send %o ...'; +use constant description => <<'DESCRIPTION'; +Send a message to one or more targets. +Targets can be single recipients or groups, when defined. + +When 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 => ( + ['origin|from=s', "Faked sender ID"], + ['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; -- cgit v1.2.3