=head1 delete Delete a wiki page: delete "Main Page" "for teh lulz" =cut sub run_delete { my $o = shift; my $page = shift; my $summary = shift || 'Vandalism'; if (@_ > 0) { my $abort = prompt('y', 'Abort?', qq{Did you mean to delete [[$page]] with reason "$summary"?}, 'y'); return 1 if $abort; } my $success = $u->delete($page, $summary); if ($success) { print "Deletion successful\n"; } else { print "Deletion failed:\n" . " $u->{'error'}->{'details'}\n"; } } sub smry_delete { return 'delete a page'; } sub help_delete { # There has to be some way of getting this Pod fragment # from the file directly. Also, if we put it here, # Pod::Weaver won't touch the file, and that's disappointing. my $pod = <<'END'; =head1 Delete a wiki page This will delete a page on the wiki you're currently using: delete "Main Page" "for teh lulz" Make sure you quote your input correctly. =cut END my $pod_parser = Pod::Text::Termcap->new( width => 72, utf8 => 1, ); my $rendered_pod; $pod_parser->output_string(\$rendered_pod); $pod_parser->parse_string_document($pod); return $rendered_pod; }