34 lines
774 B
Perl
Executable File
34 lines
774 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
if ($#ARGV != -1) {
|
|
exit print "Usage: ctihave\n" ;
|
|
}
|
|
|
|
$tool = $ENV{"DTOOL"} ;
|
|
if ( $tool eq "" ) {
|
|
die "not configured for using CTtools\n" ;
|
|
}
|
|
|
|
require "$tool/built/include/ctutils.pl" ;
|
|
require "$tool/built/include/ctvspec.pl" ;
|
|
require "$tool/built/include/ctquery.pl" ;
|
|
require "$tool/built/include/ctproj.pl" ;
|
|
require "$tool/built/include/ctcm.pl" ;
|
|
|
|
$projname = &CTProj ;
|
|
$projname =~ tr/A-Z/a-z/ ;
|
|
$flav = &CTQueryProj( $projname ) ;
|
|
$spec = &CTResolveSpec( $projname, $flav ) ;
|
|
|
|
if ( $projname eq "" ) {
|
|
exit print "Not currently in any project tree\n" ;
|
|
}
|
|
|
|
$result = &CTCMIHave( $projname, $flav, $spec ) ;
|
|
if ( $result ne "" ) {
|
|
@splitlist = split( /\n/, $result ) ;
|
|
foreach $item ( @splitlist ) {
|
|
print $item . "\n" ;
|
|
}
|
|
}
|