|
|
|
@ -28,6 +28,15 @@ GetOptions( |
|
|
|
|
"files=s" => \$opt->{file}, |
|
|
|
|
"debug" => \$opt->{debug}, |
|
|
|
|
"action=s" => \$opt->{action}, |
|
|
|
|
"send-msg" => \$opt->{'send-msg'}, |
|
|
|
|
"send-notice" => \$opt->{'send-notice'}, |
|
|
|
|
"send-file" => \$opt->{'send-file'}, |
|
|
|
|
"create-room" => \$opt->{'create-room'}, |
|
|
|
|
"modify-room" => \$opt->{'modify-room'}, |
|
|
|
|
"delete-room-alias" => \$opt->{'delete-room-alias'}, |
|
|
|
|
"get-access-token" => \$opt->{'get-access-token'}, |
|
|
|
|
"get-room-list" => \$opt->{'get-room-list'}, |
|
|
|
|
"get-room-id" => \$opt->{'get-room-id'}, |
|
|
|
|
"conf=s" => \$opt->{conf}, |
|
|
|
|
"invite=s@" => \$opt->{invite}, |
|
|
|
|
"name=s" => \$opt->{name}, |
|
|
|
@ -49,6 +58,15 @@ if ($opt->{conf} && -e $opt->{conf}){ |
|
|
|
|
read_conf(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# alias for --action=foo is --foo |
|
|
|
|
foreach my $action (qw(send-msg send-notice send-file create-room modify-room |
|
|
|
|
delete-room-alias get-access-token get-room-list get-room-id)){ |
|
|
|
|
if ($opt->{$action}){ |
|
|
|
|
$opt->{action} = $action; |
|
|
|
|
last; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
my $lwp = LWP::UserAgent->new; |
|
|
|
|
|
|
|
|
|
my $stdin = 0; |
|
|
|
|