Define actions array before the loop

This commit is contained in:
Daniel Berteaud 2017-11-19 12:50:58 +01:00
parent d99c85b77a
commit 7ba80c0dfe
1 changed files with 13 additions and 3 deletions

View File

@ -59,9 +59,19 @@ if ($opt->{conf} && -e $opt->{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
setup)){
my @actions = qw(
send-msg
send-notice
send-file
create-room
modify-room
delete-room-alias
get-access-token
get-room-list
get-room-id
setup
);
foreach my $action (@actions){
if ($opt->{$action}){
$opt->{action} = $action;
last;