Cross Reference: gol-basic.t
xref
: /
osnet-11
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
lib
/
Getopt
/
Long
/
t
/
gol-basic.t
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
1
N/A
#!./perl -w
1
N/A
1
N/A
BEGIN
{
1
N/A
if
(
$ENV
{
PERL_CORE
})
{
1
N/A
@
INC
=
'../lib'
;
1
N/A
chdir
't'
;
1
N/A
}
1
N/A
}
1
N/A
1
N/A
use
Getopt
::
Long
qw
(:
config
no_ignore_case
)
;
1
N/A
die
(
"Getopt::Long version 2.23_03 required--this is only version "
.
1
N/A
$Getopt
::
Long
::
VERSION
)
1
N/A
unless
$Getopt
::
Long
::
VERSION
ge
"2.24"
;
1
N/A
1
N/A
print
"1..9\n"
;
1
N/A
1
N/A
@
ARGV
=
qw
(-
Foo
-
baR
--
foo
bar
)
;
1
N/A
undef
$opt_baR
;
1
N/A
undef
$opt_bar
;
1
N/A
print
"ok 1\n"
if
GetOptions
(
"foo"
,
"Foo=s"
)
;
1
N/A
print
(
(
defined
$opt_foo
)
?
""
:
"not "
,
"ok 2\n"
)
;
1
N/A
print
(
(
$opt_foo
==
1
)
?
""
:
"not "
,
"ok 3\n"
)
;
1
N/A
print
(
(
defined
$opt_Foo
)
?
""
:
"not "
,
"ok 4\n"
)
;
1
N/A
print
(
(
$opt_Foo
eq
"-baR"
)
?
""
:
"not "
,
"ok 5\n"
)
;
1
N/A
print
(
(@
ARGV
==
1
)
?
""
:
"not "
,
"ok 6\n"
)
;
1
N/A
print
(
(
$ARGV
[
0
]
eq
"bar"
)
?
""
:
"not "
,
"ok 7\n"
)
;
1
N/A
print
(!
(
defined
$opt_baR
)
?
""
:
"not "
,
"ok 8\n"
)
;
1
N/A
print
(!
(
defined
$opt_bar
)
?
""
:
"not "
,
"ok 9\n"
)
;