Changeset 685 for LATMOS-Accounts/bin/la-delete
- Timestamp:
- 01/21/10 02:33:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/bin/la-delete
r664 r685 21 21 'b|base=s' => \my $base, 22 22 'o|object=s' => \my $otype, 23 'force' => \my $force, 23 24 'help' => sub { pod2usage(0) }, 24 25 ) or pod2usage(); … … 42 43 Query will be performed on this object. Default is the 'User' object. 43 44 45 =item --force 46 47 Do not ask confirmation before deleting 48 44 49 =back 45 50 … … 53 58 $labase->wexported(1); 54 59 60 if (!$labase->get_object($otype, $ARGV[0])) { 61 die "Cannot find object $otype $ARGV[0]\n"; 62 } 63 64 if (!$force) { 65 my $alea = int(rand(1000)); 66 print "Deleting object is definitive !\n"; 67 print "Are you sure you want to delete objet $otype $ARGV[0] ?\n"; 68 print "To confirm please enter this number: $alea\n"; 69 my $enter = <STDIN>; 70 chomp($enter); 71 if (!($enter =~ /^\d+$/ && $enter == $alea)) { 72 die "Wonrg input, aborting\n"; 73 } 74 } 75 55 76 if ($labase->delete_object($otype, $ARGV[0])) { 56 77 $labase->commit;
Note: See TracChangeset
for help on using the changeset viewer.