text
stringlengths
0
834k
my @all_args = @ARGV;
my (@http_confs, @stream_confs, @http_includes, @main_confs, @main_includes,
@shdicts, @ns, @src_a);
my $errlog_level = ""warn"";
my ($use_gdb, $use_valgrind, $use_rr, $version, $gdb_opts, $user_runner);
my ($use_stap, $stap_opts);
my ($conns_num, @inc_dirs, $jit_dumper, $valgrind_opts, $resolve_ipv6);
my $lua_shared_dicts = '';
my $no_stream;
{
# Note: we do not use external modules like Getopt::Long because we want
# to maximum startup speed.
my @args = @ARGV;
my $nargs = @args;
my $found_opts;
while (@args) {
my $arg = shift @args;
if ($arg =~ /^-/) {
$found_opts = 1;
if ($arg eq '-I') {
my $v = shift @args;
if (!defined $v) {
die ""option -I takes an argument but found none.\n"";
}
push @inc_dirs, $v;
next;
}
if ($arg =~ /^-I=?(.*)/) {
push @inc_dirs, $1;
next;
}
if ($arg eq '-e') {
my $v = shift @args;
if (!defined $v) {
die ""option -e takes an argument but found none.\n"";
}
push @src_a, $v;
next;
}
if ($arg =~ /^-e=?(.*)/) {
push @src_a, $1;
next;
}
if ($arg eq '-l') {
my $v = shift @args;
if (!defined $v) {
die ""option -l takes an argument but found none.\n"";
}
my $quoted_lua_lib = quote_as_lua_str($v);
my $lua = ""require($quoted_lua_lib)"";
push @src_a, $lua;
next;
}
if ($arg =~ /^-l=?(.*)/) {
my $v = $1;
my $quoted_lua_lib = quote_as_lua_str($v);
my $lua = ""require($quoted_lua_lib)"";
push @src_a, $lua;
next;
}
if ($arg eq '-j') {
if (defined $jit_dumper) {
die ""duplicate -j opton found.\n"";
}
$jit_dumper = shift @args;
if (!defined $jit_dumper) {
die ""option -j takes an argument but found none.\n"";
}
next;
}
if ($arg =~ /^-j=?(.*)/) {
if (defined $jit_dumper) {
die ""duplicate -j opton found.\n"";
}
$jit_dumper = $1;
next;
}
if ($arg eq '-c') {
$conns_num = shift @args;
if (!defined $conns_num) {
die ""option -c takes an argument but found none.\n"";