36 lines
762 B
Perl
36 lines
762 B
Perl
#!/usr/local/bin/perl
|
|
|
|
if ( $#ARGV != 1 ) {
|
|
exit print "Usage: ctmv from-element to-element\n" ;
|
|
}
|
|
|
|
$tool = $ENV{"DTOOL"} ;
|
|
if ( $tool eq "" ) {
|
|
die "Environment not configured for CTtools" ;
|
|
}
|
|
|
|
require "$tool/include/ctutils.pl" ;
|
|
require "$tool/include/ctvspec.pl" ;
|
|
require "$tool/include/ctquery.pl" ;
|
|
require "$tool/include/ctproj.pl" ;
|
|
require "$tool/include/ctcm.pl" ;
|
|
|
|
$projname = &CTProj ;
|
|
$projname =~ tr/A-Z/a-z/ ;
|
|
$flav = &CTQueryProj( $projname ) ;
|
|
$spec = &CTResolveSpec( $projname, $flav ) ;
|
|
|
|
$from = $ARGV[0] ;
|
|
$to = $ARGV[1] ;
|
|
|
|
if ( -e $from ) {
|
|
if ( -e $to ) {
|
|
print STDERR "'$to' already exists.\n" ;
|
|
} else {
|
|
if ( ! &CTCMMv( $from, $to, $projname, $spec ) ) {
|
|
}
|
|
}
|
|
} else {
|
|
print STDERR "No such element '$from'.\n" ;
|
|
}
|