| 1 | package App::SD::CLI::Command::Help::ticket_summary_format; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'App::SD::CLI::Command::Help'; | ||
| 4 | |||
| 5 | sub run { | ||
| 6 | my $self = shift; | ||
| 7 | $self->print_header('The ticket.summary-format configuration option'); | ||
| 8 | |||
| 9 | print <<EOF | ||
| 10 | The ticket.summary-format configuration directive consists of any number | ||
| 11 | of comma-separated groups, with each group separated from the next by a | ||
| 12 | vertical bar (|). Any amount of whitespace may appear before or after the | and | ||
| 13 | will not affect the summary format. | ||
| 14 | |||
| 15 | Here is an example: | ||
| 16 | |||
| 17 | [ticket] | ||
| 18 | summary-format = %5.5s },\$luid | %8.8s,status,bold green | %-52.52s,summary | ||
| 19 | |||
| 20 | Let's deconstruct this example. It consists of three groups. The first group is | ||
| 21 | '%5.5s },\$luid'. The first item of the group should look somewhat familiar to | ||
| 22 | anyone who's programmed in Perl or C before. It consists of a format string, | ||
| 23 | like that used in Perl's and C's printf function, and can be prefixed or | ||
| 24 | followed by any other characters (' }' in this case). | ||
| 25 | |||
| 26 | The second item is the property to be formatted. It can be any ticket property, | ||
| 27 | but if you want the local uid (luid) or the universal uid (uuid), it must be | ||
| 28 | prefixed with the \$ character (see the first group in the example). | ||
| 29 | |||
| 30 | The third (optional) item is the color to print the text for the given | ||
| 31 | property in, using the grammer | ||
| 32 | "<modifier> <foreground color> <background color>" and drawing from the | ||
| 33 | options: | ||
| 34 | |||
| 35 | modifiers: | ||
| 36 | |||
| 37 | bold, dark, underline, underscore, reverse, concealed | ||
| 38 | |||
| 39 | foreground colors: | ||
| 40 | |||
| 41 | black, red, green, yellow, blue, magenta, cyan, white | ||
| 42 | |||
| 43 | background colors: | ||
| 44 | |||
| 45 | on_black, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, | ||
| 46 | on_white | ||
| 47 | |||
| 48 | Modifiers, foreground colors, and background colors can be specified | ||
| 49 | individually or just two of three, rather than having to specify all | ||
| 50 | three. | ||
| 51 | |||
| 52 | When printing the summary format for the ticket, the value of the given | ||
| 53 | property for that ticket will be subbed into the format string (e.g. '%s') and | ||
| 54 | any non-format characters in the format field will be printed as-is. If no | ||
| 55 | format field is supplied with a given atom, '%s' is assumed. | ||
| 56 | |||
| 57 | For more help on format strings, see | ||
| 58 | http://perldoc.perl.org/functions/sprintf.html. | ||
| 59 | EOF | ||
| 60 | |||
| 61 | } | ||
| 62 | |||
| 63 | __PACKAGE__->meta->make_immutable; | ||
| 64 | no Any::Moose; | ||
| 65 | |||
| 66 | 1; | ||
| 67 |