Changeset 38c584e for perl/modules


Ignore:
Timestamp:
Aug 20, 2017, 4:38:40 PM (7 years ago)
Author:
Alex Dehnert <adehnert@mit.edu>
Children:
1f69b54
Parents:
fb27b30
git-author:
Edward Z. Yang <ezyang@cs.stanford.edu> (03/22/14 02:17:36)
git-committer:
Alex Dehnert <adehnert@mit.edu> (08/20/17 16:38:40)
Message:
Fix quoting conventions for Twitter commands.

Two bugs here:

1. The documentation incorrectly implies that arguments can be
omitted, when really the argument parser is much dumber than that.
If there are two optional arguments, you can't omit the first one
and give the second one; that's ambiguous.

2. There is a codepath for replycmd when status_id is not set
(this should be impossible) which passed wrong arguments.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Location:
perl/modules/Twitter/lib/BarnOwl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Twitter/lib/BarnOwl/Message/Twitter.pm

    r8106870 r38c584e  
    3636        return BarnOwl::quote('twitter-atreply', $self->sender, $self->{status_id}, $self->account);
    3737    } else {
    38         return BarnOwl::quote('twitter-atreply', $self->sender, $self->account);
     38        # Give a dummy status ID
     39        return BarnOwl::quote('twitter-atreply', $self->sender, '', $self->account);
    3940    }
    4041}
  • perl/modules/Twitter/lib/BarnOwl/Module/Twitter.pm

    r140429f r38c584e  
    243243BarnOwl::new_command(twitter => \&cmd_twitter, {
    244244    summary     => 'Update Twitter from BarnOwl',
    245     usage       => 'twitter [ACCOUNT] [MESSAGE]',
     245    usage       => 'twitter [ACCOUNT [MESSAGE]]',
    246246    description => 'Update Twitter on ACCOUNT. If MESSAGE is provided, use it as your status.'
    247247    . "\nIf no ACCOUNT is provided, update all services which have publishing enabled."
     
    259259    {
    260260    summary     => 'Send a Twitter @ message',
    261     usage       => 'twitter-atreply USER [ACCOUNT]',
     261    usage       => 'twitter-atreply USER [ID [ACCOUNT]]',
    262262    description => 'Send a Twitter @reply Message to USER on ACCOUNT (defaults to default_sender,'
    263263    . "\nor first service if no default is provided)"
Note: See TracChangeset for help on using the changeset viewer.