ctrm 748 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/perl
  2. if ( $#ARGV < 0 ) {
  3. exit print "Usage: ctrmelem element-name [...]\n" ;
  4. }
  5. $tool = $ENV{"DTOOL"} ;
  6. if ( $tool eq "" ) {
  7. die "Environment not configured for CTtools" ;
  8. }
  9. require "$tool/built/include/ctutils.pl" ;
  10. require "$tool/built/include/ctvspec.pl" ;
  11. require "$tool/built/include/ctquery.pl" ;
  12. require "$tool/built/include/ctproj.pl" ;
  13. require "$tool/built/include/ctcm.pl" ;
  14. $projname = &CTProj ;
  15. $projname =~ tr/A-Z/a-z/ ;
  16. $flav = &CTQueryProj( $projname ) ;
  17. $spec = &CTResolveSpec( $projname, $flav ) ;
  18. foreach $item ( @ARGV ) {
  19. if ( -e $item ) {
  20. if ( ! &CTCMRmElem( $item, $projname, $spec ) ) {
  21. print STDERR "Could not rmname '$item'\n" ;
  22. }
  23. } else {
  24. print STDERR "No such file '$item'.\n" ;
  25. }
  26. }