Commit 211b457e authored by Luc Didry's avatar Luc Didry

Add pad creation by calling "create <pad>"

parent e0319946
Revision history for Perl module App::padconsole
0.08 2013-11-05
- Add pad creation by calling "create <pad>"
0.07 2013-10-26
- Fixed #5: Make history persistent
- bug fixes
......
......@@ -53,6 +53,10 @@ COMMANDS
current : print configuration informations about the current etherpad instance
open <pad> : open pad in browser. If no pad is given, open the etherpad instance home page
create <pad> : create pad <pad>. If it already exists, print a warning
CONFIGURATION FILE
You can write it (that a simple YAML file), or launch padconsole with
valid etherpad informations (options *-e*, *-k* and possibly *-u* and
......@@ -63,6 +67,7 @@ CONFIGURATION FILE
will push the new instance in the configuration file.
---
browser: x-www-browser
instances:
beta:
url: http://pad1.example.com
......
package App::padconsole;
our $VERSION = '0.05';
our $VERSION = '0.08';
1;
=head1 NAME
......
......@@ -19,7 +19,7 @@ use Browser::Open qw/open_browser_cmd/;
BEGIN {
use Exporter ();
use vars qw($VERSION);
$VERSION = '0.07';
$VERSION = '0.08';
}
$Getopt::Std::STANDARD_HELP_VERSION = 1;
......@@ -245,6 +245,8 @@ while (defined($_ = $term->readline($prompt))) {
_current()
} elsif ($command eq 'open') {
_open()
} elsif ($command eq 'create') {
_create()
} else {
print 'WARNING: Unknown command', "\n";
_help();
......@@ -271,9 +273,24 @@ Available commands:
- alist : print all the configured etherpads aliases
- current : print configuration informations about the current etherpad instance
- open <pad> : open pad in browser. If no pad is given, open the etherpad instance home page
- create <pad> : create pad <pad>. If it already exists, print a warning
EOF
}
sub _create {
my $pad = shift @commands;
if (!defined $pad || !$pad) {
print 'Please provide a pad name', "\n";
} else {
my $res = $ec->create_pad($pad);
if ($res) {
print 'Pad created', "\n";
} else {
print 'ERROR: pad creation unsuccessful !', "\n";
}
}
}
sub _open {
my $pad = shift @commands;
my $url = $instances{$alias}->{url};
......@@ -551,6 +568,10 @@ Once the padconsole is launched, you can use this commands:
current : print configuration informations about the current etherpad instance
open <pad> : open pad in browser. If no pad is given, open the etherpad instance home page
create <pad> : create pad <pad>. If it already exists, print a warning
=head1 CONFIGURATION FILE
You can write it (that a simple YAML file), or launch padconsole with valid etherpad informations (options I<-e>, I<-k> and possibly I<-u> and I<-p>) and then use the I<writeconf> command.
......
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