Commit 66bdd42e authored by Luc Didry's avatar Luc Didry

Version 0.10

- Use Etherpad instead of Etherpad::API (which is deprecated)
- Add html method
- Fix "Wide character" issue
parent 4d8b04e0
Revision history for Perl module App::padconsole
0.10 2016-11-22
- Use Etherpad instead of Etherpad::API (which is deprecated)
- Add html method
- Fix "Wide character" issue
0.09 2015-03-09
- Requests at least Etherpad::API 1.2.10.3 (older versions are buggy)
......
......@@ -11,7 +11,7 @@ WriteMakefile(
'LICENSE' => 'perl',
'PREREQ_PM' => {
'Etherpad::API' => '1.2.10.3',
'Etherpad' => '1.2.10.3',
'Term::ReadLine' => 0,
'Config::YAML' => 0,
'URI::Escape' => 0,
......
......@@ -22,6 +22,8 @@ DESCRIPTION
-c /path/to/config/file use a different config file than \$XDG_HOME_DIR/padconsolerc or ~/.config/padconsolerc
-b x-www-browser use this browser to open pads or etherpad instance home page
COMMANDS
Once the padconsole is launched, you can use this commands:
......@@ -39,6 +41,8 @@ COMMANDS
text <pad> [rev] : print the pad content, at the revision [rev] if defined
html <pad> [rev] : print the pad HTML export, at the revision [rev] if defined
revcount <pad> : print the number of revisions of a pad
authors <pad> : print the name of the differents authors who wrote on the pad
......
package App::padconsole;
our $VERSION = '0.09';
our $VERSION = '0.10';
1;
=head1 NAME
......
......@@ -9,17 +9,18 @@ use IPC::Open3;
use File::Spec::Functions;
use File::Path qw/make_path/;
use Etherpad::API;
use Etherpad;
use Term::ReadLine;
use Config::YAML;
use URI::Escape;
use DateTime;
use Browser::Open qw/open_browser_cmd/;
binmode STDOUT, ":utf8";
BEGIN {
use Exporter ();
use vars qw($VERSION);
$VERSION = '0.09';
$VERSION = '0.10';
}
$Getopt::Std::STANDARD_HELP_VERSION = 1;
......@@ -202,11 +203,12 @@ if (-f $history_file) {
my $prompt = $alias.' $ ';
# For autocomplete
my @words = qw(exit help count
list search delete
text revcount authors
infos writeconf use
alist current open);
my @words = qw(exit help count
list search delete
text html revcount
authors infos writeconf
use alist current
open);
my @commands;
while (defined($_ = $term->readline($prompt))) {
......@@ -229,6 +231,8 @@ while (defined($_ = $term->readline($prompt))) {
_delete()
} elsif ($command eq 'text') {
_text()
} elsif ($command eq 'html') {
_html()
} elsif ($command eq 'revcount') {
_revcount()
} elsif ($command eq 'authors') {
......@@ -265,6 +269,7 @@ Available commands:
- search <PATTERN> : print the list of the pads which name matches the pattern (Perl regex) (20 items per page)
- delete <pad1> <pad2> : delete the pads pad1 pad2 (have to be separated by space)
- text <pad> [rev] : print the pad content, at the revision [rev] if defined
- html <pad> [rev] : print the pad HTML export, at the revision [rev] if defined
- revcount <pad> : print the number of revisions of a pad
- authors <pad> : print the name of the differents authors who wrote on the pad
- infos <pad> : print multiple informations about the pad
......@@ -428,6 +433,21 @@ sub _text {
}
}
sub _html {
my $pad = shift @commands;
my $rev = shift @commands;
if (defined $pad) {
if (defined $rev) {
print $ec->get_html($pad, $rev);
} else {
print $ec->get_html($pad);
}
} else {
print 'ERROR: no pad given !', "\n";
}
}
sub _delete {
foreach my $arg (@commands) {
if (!defined $ec->get_revisions_count($arg)) {
......@@ -556,6 +576,8 @@ Once the padconsole is launched, you can use this commands:
text <pad> [rev] : print the pad content, at the revision [rev] if defined
html <pad> [rev] : print the pad HTML export, at the revision [rev] if defined
revcount <pad> : print the number of revisions of a pad
authors <pad> : print the name of the differents authors who wrote on the pad
......@@ -602,7 +624,7 @@ The better way to install it is by CPAN:
You can install it manually:
wget https://github.com/ldidry/padconsole/archive/master.zip -O padconsole.zip
wget "https://framagit.org/luc/padconsole/repository/archive.zip?ref=master" -O padconsole.zip
unzip padconsole.zip
cd padconsole-master
perl Makefile.PL
......@@ -618,12 +640,12 @@ You can install it manually:
Bugs and feature requests will be tracked at github:
https://github.com/ldidry/padconsole/issues/
https://framagit.org/luc/padconsole/issues/
The latest source code can be browsed and fetched at:
https://github.com/ldidry/padconsole
git clone git://github.com/ldidry/padconsole.git
https://framagit.org/luc/padconsole
git clone https://framagit.org/luc/padconsole.git
You can also look for information at:
......@@ -644,7 +666,7 @@ You can install it manually:
Luc DIDRY
CPAN ID: LDIDRY
ldidry@cpan.org
http://www.fiat-tux.fr/
https://fiat-tux.fr/
=head1 COPYRIGHT
......@@ -654,4 +676,4 @@ You can install it manually:
=head1 SEE ALSO
L<Etherpad::API>, L<https://github.com/ldidry/etherpad-admin>
L<Etherpad>, L<https://framagit.org/luc/etherpad-admin>
......@@ -4,7 +4,7 @@ use warnings;
use strict;
use Test::More tests => 6;
use_ok( 'Etherpad::API' );
use_ok( 'Etherpad' );
use_ok( 'Term::ReadLine' );
use_ok( 'Config::YAML' );
use_ok( 'URI::Escape' );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment