| 1 | package App::SD::CLI::Command::Help::Config; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'App::SD::CLI::Command::Help'; | ||
| 4 | |||
| 5 | sub run { | ||
| 6 | my $self = shift; | ||
| 7 | $self->print_header('Configuration Options'); | ||
| 8 | my ${cmd}= $self->cli->get_script_name; | ||
| 9 | |||
| 10 | print <<EOF | ||
| 11 | SD supports a layered configuration system with three configuration | ||
| 12 | files: a global file (/etc/sdrc), a user-wide configuration file | ||
| 13 | (\$HOME/.sdrc) and a per-replica configuration file (/path/to/replica/config). | ||
| 14 | Configuration variables in more local configuration files override | ||
| 15 | those in more global ones. | ||
| 16 | |||
| 17 | You can use the '${cmd}config' command to view what configuration files | ||
| 18 | SD has loaded and all loaded configuration variables, as they apply | ||
| 19 | to the current replica. | ||
| 20 | |||
| 21 | '${cmd}config' can also be used to set configuration variables. | ||
| 22 | |||
| 23 | Examples: | ||
| 24 | |||
| 25 | ${cmd}config user.email-address user\@example.com | ||
| 26 | ${cmd}config --delete user.email-address | ||
| 27 | ${cmd}config user.email-address | ||
| 28 | Print the current value of this configuration variable. | ||
| 29 | ${cmd}config alias.'this.alias.contains.dots' 'so it must be quoted' | ||
| 30 | ${cmd}config edit | ||
| 31 | ${cmd}config edit --user | ||
| 32 | ${cmd}config edit --global | ||
| 33 | Edit the specified config file in an editor. | ||
| 34 | |||
| 35 | The configuration file format is similar to that of the VCS 'Git'. See | ||
| 36 | http://www.kernel.org/pub/software/scm/git/docs/git-config.html for | ||
| 37 | specifics. The biggest thing you need to know is that the config file | ||
| 38 | contains key/value variables, contained in sections and subsections. | ||
| 39 | |||
| 40 | In the help documents, we'll refer to variables in the manner: | ||
| 41 | "section-name.subsection-name.variable-name". In a configuration file, | ||
| 42 | this would look like: | ||
| 43 | |||
| 44 | [section-name "subsection-name"] | ||
| 45 | variable-name = value | ||
| 46 | |||
| 47 | Here's an example of an actual configuration file, aimed at being | ||
| 48 | a user-wide config file that affects all bug databases: | ||
| 49 | |||
| 50 | [user] | ||
| 51 | email-address = me\@example.com | ||
| 52 | [ticket] | ||
| 53 | summary-format = %5.5s,\$luid | %8.8s,status | %7.7s,component |%12.12s,owner| %-44.44s,summary | ||
| 54 | default-group = milestone | ||
| 55 | [alias] | ||
| 56 | mine = ticket list -- owner=~me status!~closed|rejected | ||
| 57 | |||
| 58 | Currently, the following configuration variables are available (sorted | ||
| 59 | by configuration file section): | ||
| 60 | |||
| 61 | ticket.summary-format = %4s },\$luid | %-11.11s,status | %-60.60s,summary | ||
| 62 | Specifies how to format ticket summaries (when listing tickets, e.g.). | ||
| 63 | (See also: '${cmd}help ticket.summary-format'.) | ||
| 64 | |||
| 65 | ticket.common-props = id,summary,status,owner,created,original_replica | ||
| 66 | A comma-separated list of ticket properties that are most-often | ||
| 67 | used. These properties will be shown by default in the 'ticket | ||
| 68 | show' command and presented for editing when interactively | ||
| 69 | creating or updating tickets. (Overrides the database-wide | ||
| 70 | setting of the same name.) | ||
| 71 | |||
| 72 | ticket.default-sort = status | ||
| 73 | Bug property to determine order of display when displaying lists of | ||
| 74 | tickets. (Can be any property; will be compared lexically.) | ||
| 75 | |||
| 76 | ticket.<prop>.sort-undef-last = true | ||
| 77 | When sorting on <prop>, setting this will make tickets where | ||
| 78 | the property is undefined sort *after* any records where the | ||
| 79 | property *is* defined. (The default is the opposite.) | ||
| 80 | Useful for e.g. due dates. | ||
| 81 | |||
| 82 | ticket.default-group = milestone | ||
| 83 | Bug property to group tickets by when displaying lists of tickets. (Can | ||
| 84 | be any property.) | ||
| 85 | |||
| 86 | ticket.show.disable-history = 1 | ||
| 87 | Don't display ticket history when running '${cmd}ticket show'. Can | ||
| 88 | be overridden by passing the '--with-history' arg to the | ||
| 89 | command. | ||
| 90 | |||
| 91 | user.email-address = foo\@bar.com | ||
| 92 | Specifies an email address to use as the default for tickets' | ||
| 93 | reporter field. (Overrides the EMAIL environmental variable if | ||
| 94 | that is also set.) | ||
| 95 | |||
| 96 | server.default-port = 8080 | ||
| 97 | Specifies a default port to use for the 'server' and 'browser' | ||
| 98 | commands. Can still be overridden by passing '--port' to these | ||
| 99 | commands. | ||
| 100 | |||
| 101 | For information on environmental variables that can affect SD, see | ||
| 102 | '${cmd}help environment'. | ||
| 103 | EOF | ||
| 104 | |||
| 105 | } | ||
| 106 | |||
| 107 | __PACKAGE__->meta->make_immutable; | ||
| 108 | no Any::Moose; | ||
| 109 | |||
| 110 | 1; | ||
| 111 |