summaryrefslogtreecommitdiff
path: root/lib/App/smsg/Command/Chain.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/smsg/Command/Chain.pm')
-rw-r--r--lib/App/smsg/Command/Chain.pm58
1 files changed, 58 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;