[Bps-public-commit] r16858 - in sd/trunk/lib/App/SD/CLI: . Command/Help

jesse at bestpractical.com jesse at bestpractical.com
Sat Nov 15 22:23:39 EST 2008


Author: jesse
Date: Sat Nov 15 22:23:38 2008
New Revision: 16858

Added:
   sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm
   sd/trunk/lib/App/SD/CLI/Command/Version.pm
Modified:
   sd/trunk/lib/App/SD/CLI/Command/Help.pm
   sd/trunk/lib/App/SD/CLI/Command/Help/Sync.pm
   sd/trunk/lib/App/SD/CLI/Dispatcher.pm

Log:
* Added a version command
* Added the beginning of an intro help document


Modified: sd/trunk/lib/App/SD/CLI/Command/Help.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Help.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Help.pm	Sat Nov 15 22:23:38 2008
@@ -16,11 +16,17 @@
     return $cmd;
 }
 
+sub version {
+    my $self = shift;
+    "sd ".$App::SD::VERSION;
+
+}
 
 sub print_header {
     my $self = shift;
     my $title = shift;
-    my $string =  "sd ".$App::SD::VERSION." - " .$title;
+    my $string =  join(' - ', $self->version, $title);
+    
     
     print "\n".$string . "\n";
     print '-' x ( length($string));
@@ -37,6 +43,7 @@
 
 print <<EOF
 
+$cmd help intro       -  Getting started with SD
 $cmd help search      -  Searching for and displaying tickets
 $cmd help tickets     -  Working with tickets
 $cmd help comments    -  Working with ticket comments

Added: sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm
==============================================================================
--- (empty file)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm	Sat Nov 15 22:23:38 2008
@@ -0,0 +1,51 @@
+package App::SD::CLI::Command::Help::Intro;
+use Moose;
+extends 'App::SD::CLI::Command::Help';
+
+sub run {
+    my $self = shift;
+    $self->print_header('Getting started with SD');
+    my $cmd = $self->_get_cmd_name;
+
+print <<EOF
+SD is a peer to peer issue tracking system built on the Prophet 
+distributed database. SD is designed to make it easy to work with issues
+and to share issue databases with your collaborators.
+
+To get started with SD, you need an issue database. To get an issue 
+database, you have two options: You can clone an existing database
+or start a new one.
+
+SD will store its local database replica in the ".sd" directory in your 
+home directory. You can override this behaviour by setting the SD_REPO
+environment variable.
+
+To clone an issue database:
+
+    $cmd clone --from http://example.com/path/to/sd
+
+To start a new issue database:
+
+    $cmd init
+
+To create a ticket, run:
+
+    $cmd ticket create
+
+To publish your database:
+
+    $cmd publish --to joeuser\@myhost.example.com:public_html/mydb
+
+To learn a bit more about what you can do with SD:
+    
+    $cmd help
+
+EOF
+
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
+

Modified: sd/trunk/lib/App/SD/CLI/Command/Help/Sync.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Help/Sync.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/Sync.pm	Sat Nov 15 22:23:38 2008
@@ -9,13 +9,18 @@
     my $cmd = $self->_get_cmd_name;
 
 print <<EOF
+
+ $cmd clone --from http://example.com/path/to/sd
+    Create a new copy (replica) of a published SD replica from an
+    http, ftp or file URL.
+
  $cmd pull --from http://example.com/path/to/sd
     Integrate changes from a published SD replica over http, ftp or 
-    file URL schemes.
+    file URL.
  
  $cmd pull --all
     Integrate changes from all replicas this replica has pulled from
-    before
+    before.
 
  $cmd pull --local
     Integrate changes from all replicas currently announcing themselves

Added: sd/trunk/lib/App/SD/CLI/Command/Version.pm
==============================================================================
--- (empty file)
+++ sd/trunk/lib/App/SD/CLI/Command/Version.pm	Sat Nov 15 22:23:38 2008
@@ -0,0 +1,15 @@
+package App::SD::CLI::Command::Version;
+
+use Moose;
+extends 'App::SD::CLI::Command::Help';
+
+sub run { 
+    my $self = shift;
+    print $self->version ."\n";
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
+

Modified: sd/trunk/lib/App/SD/CLI/Dispatcher.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Dispatcher.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Dispatcher.pm	Sat Nov 15 22:23:38 2008
@@ -14,6 +14,7 @@
 #on '' => run_command('Shell');
 
 under help => sub {
+    on intro   => run_command('Help::Intro');
     on about   => run_command('Help::About');
     on config  => run_command('Help::Config');
     on copying => run_command('Help::Copying');



More information about the Bps-public-commit mailing list