#!/usr/bin/perl package MyShell; use base qw(Term::Shell); my $shell = MyShell->new; $shell->cmdloop; use strict; use warnings; use Term::Shell; use Pod::Select; use Pod::Usage; 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 $u; my $success = $u->delete($page, $summary); if ($success) { print "Deletion successful\n"; } else { print "Deletion failed:\n" . " $u->{'error'}->{'details'}\n"; } } sub run_smry_delete { print "delete a page", "\n"; } sub run_help_delete { my $file = '/path/to/this/script.pl'; podselect({ -sections => ["NAME|DELETE", "OPTIONS" ]}, $file); } =head1 DELETE 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
In reply to Re: Extracting and formatting Pod sections
by Khen1950fx
in thread Extracting and formatting Pod sections
by Mike.lifeguard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |