summaryrefslogtreecommitdiff
path: root/lib/App/smsg/Command/Send.pm
blob: facbde582f7155a730b779533a9fd4e16fd3762f (plain)
  1. package App::smsg::Command::Send;
  2. use 5.010;
  3. use strict;
  4. use warnings;
  5. use utf8;
  6. BEGIN {
  7. $App::smsg::Command::Send::AUTHORITY = 'https://dr.jones.dk/me#me';
  8. $App::smsg::Command::Send::VERSION = '0.001';
  9. }
  10. use App::smsg -command;
  11. use namespace::clean;
  12. use constant abstract => q (Send a message to one or more recipients.);
  13. use constant usage_desc => '%c send %o <recipient>...';
  14. use constant description => <<'DESCRIPTION';
  15. Send a message to one or more targets.
  16. Targets can be single recipients or groups, when defined.
  17. When an option is needed but not provided, it is attempted resolved from
  18. previous related communication, then from defaults, and then
  19. interactively prompted for.
  20. DESCRIPTION
  21. use constant opt_spec => (
  22. ['origin|from=s', "Faked sender ID"],
  23. ['target|to=s', "Recipient ID"],
  24. ['platform|on=s', "Platform to operate on. Either generic (chat, sms, microblog) or specific (kannel, jabber, irc, twitter, status.net)."],
  25. ['intermediary|via=s', "Message center, host or net to use in case of multiple routes"],
  26. [],
  27. # [ 'verbose|v', "print extra stuff"],
  28. [ 'debug', "print debug stuff"],
  29. );
  30. sub validate_args {
  31. my ($self, $opt, $args) = @_;
  32. $self->usage_error("too few arguments") unless @$args >= 1;
  33. }
  34. sub execute {
  35. my ($self, $opt, $args) = @_;
  36. # TODO: error if pause and no active chain
  37. # TODO: error if continue and no paused chain
  38. die 'FIXME: unimplemented!';
  39. }
  40. 1;