summaryrefslogtreecommitdiff
path: root/lib/App/smsg/Command/Chain.pm
blob: 90dc24f2339fe76b5c5e5324aed31ce979941f6b (plain)
  1. package App::smsg::Command::Chain;
  2. use 5.010;
  3. use strict;
  4. use warnings;
  5. use utf8;
  6. BEGIN {
  7. $App::smsg::Command::Chain::AUTHORITY = 'https://dr.jones.dk/me#me';
  8. $App::smsg::Command::Chain::VERSION = '0.001';
  9. }
  10. use App::smsg -command;
  11. use namespace::clean;
  12. use constant abstract => q (Handle chains of (varying delayed) responses.);
  13. use constant usage_desc => '%c chain %o <action> [<chain>...]';
  14. use constant description => <<'DESCRIPTION';
  15. Compose, monitor or interact with chains of responses.
  16. Composition actions: create, join, drop, content, list.
  17. Monitoring actions: follow.
  18. Keep connection open and emit each change of state.
  19. Interactive actions: begin, pause, continue, cancel, status.
  20. Each target can connect to one chain at a time, i.e. begin implies drop.
  21. When chain or an option is needed but not provided, it is attempted
  22. resolved from previous related communication, then from defaults, and
  23. then interactively prompted for.
  24. DESCRIPTION
  25. use constant opt_spec => (
  26. ['target|to=s', "Recipient ID"],
  27. ['platform|on=s', "Platform to operate on. Either generic (chat, sms, microblog) or specific (kannel, jabber, irc, twitter, status.net)."],
  28. ['intermediary|via=s', "Message center, host or net to use in case of multiple routes"],
  29. [],
  30. # [ 'verbose|v', "print extra stuff"],
  31. [ 'debug', "print debug stuff"],
  32. );
  33. sub validate_args {
  34. my ($self, $opt, $args) = @_;
  35. $self->usage_error("too few arguments") unless @$args >= 1;
  36. }
  37. sub execute {
  38. my ($self, $opt, $args) = @_;
  39. # TODO: error if pause and no active chain
  40. # TODO: error if continue and no paused chain
  41. die 'FIXME: unimplemented!';
  42. }
  43. 1;