#!/usr/bin/perl

use strict;
use warnings;

use utf8;

use open qw/:std :encoding(UTF-8)/;

use Cwd;
use JSON;

run() unless caller();

sub run {
    my $cwd = cwd();
    my ($port) = ($cwd =~ m!\.([0-9]+)$!);
    die "can't determine beta port from current directory\n" unless $port;
    # лучше брать из db-config, но пока непонятно как.
    $ENV{MYSQL_PWD} = 'utro';
    exec 'mysql', '--host', '127.0.0.10', '--port', $port, '--user', 'adiuser', @ARGV;
}

1;
