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

spang at bestpractical.com spang at bestpractical.com
Wed Jan 7 16:14:01 EST 2009


Author: spang
Date: Wed Jan  7 16:13:55 2009
New Revision: 17616

Added:
   sd/trunk/lib/App/SD/CLI/Command/Help/summary_format_ticket.pm
Modified:
   sd/trunk/   (props changed)
   sd/trunk/lib/App/SD/CLI/Command/Help/Config.pm
   sd/trunk/lib/App/SD/CLI/Dispatcher.pm

Log:
 r53380 at loki:  spang | 2009-01-07 14:11:08 +0200
 document the summary_format_ticket config option more usefully


Modified: sd/trunk/lib/App/SD/CLI/Command/Help/Config.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Help/Config.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/Config.pm	Wed Jan  7 16:13:55 2009
@@ -19,6 +19,7 @@
 
   summary_format_ticket = %4s },\$luid | %-11.11s,status | %-60.60s,summary
     Specifies how to format ticket summaries (when listing tickets, e.g.).
+    (See also: help summary_format_ticket.)
 EOF
 
 }

Added: sd/trunk/lib/App/SD/CLI/Command/Help/summary_format_ticket.pm
==============================================================================
--- (empty file)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/summary_format_ticket.pm	Wed Jan  7 16:13:55 2009
@@ -0,0 +1,44 @@
+package App::SD::CLI::Command::Help::summary_format_ticket;
+use Moose;
+extends 'App::SD::CLI::Command::Help';
+
+sub run {
+    my $self = shift;
+    $self->print_header('The summary_format_ticket Configuration Option');
+
+print <<EOF
+The summary_format_ticket configuration directive consists of any number
+of comma-separated pairs, with each pair separated from the next by a vertical
+bar (|). Any amount of whitespace may appear before or after the | and will not
+affect the summary format.
+
+Here is an example:
+
+summary_format_ticket = %5.5s },\$luid | %8.8s,status | %-52.52s,summary
+
+Let's deconstruct this example. It consists of three pairs. The first pair is
+'%5.5s },\$luid'. The first item of the pair should look somewhat familiar to
+anyone who's programmed in Perl or C before. It consists of a format string,
+like that used in C's printf function and Perl's sprintf function, and can be
+prefixed or followed by any other characters (' }' in this case).
+
+The second item is the property to be formatted. It can be any ticket property,
+but if you want the local uid (luid) or the universal uid (uuid), it must be
+prefixed with the \$ character (see the first pair in the example).
+
+When printing the summary format for the ticket, the value of the given
+property for that ticket will be subbed into the format string (e.g. '%s') and
+any non-format characters in the format field will be printed as-is. If no
+format field is supplied with a given pair, '%s' is assumed.
+
+For more help on format strings, see
+http://perldoc.perl.org/functions/sprintf.html.
+EOF
+
+}
+
+__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	Wed Jan  7 16:13:55 2009
@@ -17,6 +17,7 @@
     on about   => run_command('Help::About');
     on config  => run_command('Help::Config');
     on copying => run_command('Help::Copying');
+    on summary_format_ticket => run_command('Help::summary_format_ticket');
 
     on [ ['author', 'authors'] ]         => run_command('Help::Authors');
     on [ ['environment', 'env'] ]        => run_command('Help::Environment');



More information about the Bps-public-commit mailing list