[Bps-public-commit] SD - A distributed issue tracker branch, master, updated. d401ed000a82562179634e85cc6a1ebec1c17f34

spang at bestpractical.com spang at bestpractical.com
Tue Jan 20 17:20:24 EST 2009


The branch, master has been updated
       via  d401ed000a82562179634e85cc6a1ebec1c17f34 (commit)
       via  e9e2326ea21137817f88c5dd32db935b9a901a1f (commit)
      from  875ed6c2092376cdc7169ad82ecbed3ae70d0969 (commit)

Summary of changes:
 lib/App/SD/CLI/Command/Help.pm          |    3 +-
 lib/App/SD/CLI/Command/Help/Settings.pm |   38 +++++++++++++++++++++++++++++++
 lib/App/SD/CLI/Dispatcher.pm            |    9 ++++++-
 3 files changed, 48 insertions(+), 2 deletions(-)
 create mode 100644 lib/App/SD/CLI/Command/Help/Settings.pm

- Log -----------------------------------------------------------------
commit e9e2326ea21137817f88c5dd32db935b9a901a1f
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Jan 20 22:59:58 2009 +0200

    more appropriate error message when we can't find help on a topic

diff --git a/lib/App/SD/CLI/Dispatcher.pm b/lib/App/SD/CLI/Dispatcher.pm
index ade18bb..2dbae39 100644
--- a/lib/App/SD/CLI/Dispatcher.pm
+++ b/lib/App/SD/CLI/Dispatcher.pm
@@ -34,6 +34,12 @@ under help => sub {
 
     on [ ['sync', 'push', 'pull', 'publish', 'server'] ]
         => run_command('Help::Sync');
+
+    on qr/^(\S+)$/ => sub {
+       my $self = shift;
+       my $topic = $1;
+       die "Cannot find help on topic '$topic'. Try '$0 help'?\n";
+    };
 };
 
 on help => run_command('Help');

commit d401ed000a82562179634e85cc6a1ebec1c17f34
Author: Christine Spang <spang at bestpractical.com>
Date:   Tue Jan 20 23:17:36 2009 +0200

    help for sd settings

diff --git a/lib/App/SD/CLI/Command/Help.pm b/lib/App/SD/CLI/Command/Help.pm
index 76709be..d254e5f 100644
--- a/lib/App/SD/CLI/Command/Help.pm
+++ b/lib/App/SD/CLI/Command/Help.pm
@@ -50,8 +50,9 @@ $cmd help comments    -  Working with ticket comments
 $cmd help attachments -  Working with ticket attachments
 $cmd help sync        -  Publishing and importing ticket databases
 $cmd help environment -  Environment variables which affect sd
-$cmd help config      -  Database configuration variables
+$cmd help config      -  Local configuration variables
 $cmd help summary_format_ticket  -  Details of this config variable
+$cmd help settings    -  Database configuration variables
 
 Running '$cmd help' on a specific command should also redirect you
 to the proper help file.
diff --git a/lib/App/SD/CLI/Command/Help/Settings.pm b/lib/App/SD/CLI/Command/Help/Settings.pm
new file mode 100644
index 0000000..f55e763
--- /dev/null
+++ b/lib/App/SD/CLI/Command/Help/Settings.pm
@@ -0,0 +1,38 @@
+package App::SD::CLI::Command::Help::Settings;
+use Moose;
+extends 'App::SD::CLI::Command::Help';
+
+sub run {
+    my $self = shift;
+    $self->print_header('Database Settings');
+    my $cmd = $self->_get_cmd_name;
+
+print <<EOF
+The 'settings' command allows you to modify configuration variables
+that propagate with the current database, known as settings.
+
+If given no arguments, the settings command will present you with
+an editor window in which settings can be modified. Setting values
+must be valid JSON data structures.
+
+The following arguments are supported:
+
+    --show
+      Don't present an editor window, just print the current
+      settings to STDOUT.
+
+    --set common_ticket_props '["id", "summary", "original_replica"]'
+      Update the setting common_ticket_props to the given value.
+
+Settings are not the same as local configuration variables. For
+more information on local configuration, see '$cmd help config'.
+
+EOF
+
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
+
diff --git a/lib/App/SD/CLI/Dispatcher.pm b/lib/App/SD/CLI/Dispatcher.pm
index 2dbae39..14b6da9 100644
--- a/lib/App/SD/CLI/Dispatcher.pm
+++ b/lib/App/SD/CLI/Dispatcher.pm
@@ -23,7 +23,8 @@ under help => sub {
     on [ ['environment', 'env'] ]        => run_command('Help::Environment');
     on [ ['ticket', 'tickets'] ]         => run_command('Help::Tickets');
     on [ ['attachment', 'attachments'] ] => run_command('Help::Attachments');
-    on [ ['comment', 'comments'] ]       => run_command('Help:::Comments');
+    on [ ['comment', 'comments'] ]       => run_command('Help::Comments');
+    on [ ['setting', 'settings'] ]       => run_command('Help::Settings');
 
     on [
         ['ticket', 'attachment', 'comment'],

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list