Changeset ba7ac0d


Ignore:
Timestamp:
Aug 9, 2014, 5:30:05 PM (10 years ago)
Author:
Edward Z. Yang <ezyang@cs.stanford.edu>
Children:
8de7c84
Parents:
ea23e6d
git-author:
Edward Z. Yang <ezyang@cs.stanford.edu> (03/22/14 02:17:36)
git-committer:
Edward Z. Yang <ezyang@cs.stanford.edu> (08/09/14 17:30:05)
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 rba7ac0d  
    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 rba7ac0d  
    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.