]> Dogcows Code - chaz/git-codeowners/blob - bin/git-codeowners
d565192c139cbdab4874d539c34384418bb0a4f8
[chaz/git-codeowners] / bin / git-codeowners
1 #! perl
2 # ABSTRACT: A tool for managing CODEOWNERS files
3 # PODNAME: git-codeowners
4
5 =head1 SYNOPSIS
6
7 git-codeowners [--version|--help|--manual]
8
9 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
10
11 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
12
13 git-codeowners patterns [--format FORMAT] [--owner OWNER]
14
15 git-codeowners create|update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
16
17 # enable bash shell completion
18 eval "$(git-codeowners --shell-completion)"
19
20 =head1 DESCRIPTION
21
22 F<git-codeowners> is yet another CLI tool for managing F<CODEOWNERS> files in
23 git repos. In particular, it can be used to quickly find out who owns
24 a particular file in a monorepo (or monolith).
25
26 B<THIS IS EXPERIMENTAL!> The interface of this tool and its modules will
27 probably change as I field test some things. Feedback welcome.
28
29 =head1 OPTIONS
30
31 =head2 --version
32
33 Print the program name and version to C<STDOUT>, and exit.
34
35 Alias: C<-v>
36
37 =head2 --help
38
39 Print the synopsis to C<STDOUT>, and exit.
40
41 Alias: C<-h>
42
43 You can also use C<--manual> to print the full documentation.
44
45 =head2 --color
46
47 Enable colorized output.
48
49 Color is ON by default on terminals; use C<--no-color> to disable. Some environment variables may
50 also alter the behavior of colorizing output:
51
52 =for :list
53 * C<NO_COLOR> - Set to disable color (same as C<--no-color>).
54 * C<COLOR_DEPTH> - Set the number of supportable colors (e.g. 0, 16, 256, 16777216).
55
56 =head2 --format
57
58 Specify the output format to use. See L</FORMAT>.
59
60 Alias: C<-f>
61
62 =head2 --shell-completion
63
64 eval "$(lintany --shell-completion)"
65
66 Print shell code to enable completion to C<STDOUT>, and exit.
67
68 Does not yet support Zsh...
69
70 =head1 COMMANDS
71
72 =head2 show
73
74 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
75
76 Show owners of one or more files in a repo.
77
78 =head2 owners
79
80 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
81
82 =head2 patterns
83
84 git-codeowners patterns [--format FORMAT] [--owner OWNER]
85
86 =head2 create
87
88 git-codeowners create [REPO_DIRPATH|CODEOWNERS_FILEPATH]
89
90 Create a new F<CODEOWNERS> file for a specified repo (or current directory).
91
92 =head2 update
93
94 git-codeowners update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
95
96 Update the "unowned" list of an existing F<CODEOWNERS> file for a specified
97 repo (or current directory).
98
99 =head1 FORMAT
100
101 The C<--format> argument can be one of:
102
103 =for :list
104 * C<csv> - Comma-separated values (requires L<Text::CSV>)
105 * C<json:pretty> - Pretty JSON (requires L<JSON::MaybeXS>)
106 * C<json> - JSON (requires L<JSON::MaybeXS>)
107 * C<table> - Table (requires L<Text::Table>)
108 * C<tsv> - Tab-separated values (requires L<Text::CSV>)
109 * C<yaml> - YAML (requires L<YAML>)
110 * C<FORMAT> - Custom format (see below)
111
112 You can specify a custom format using printf-like format sequences. These are the items that can
113 substituted:
114
115 =for :list
116 * C<%F> - Filename
117 * C<%O> - Owner or owners
118 * C<%P> - Project
119 * C<%T> - Pattern
120 * C<%n> - newline
121 * C<%t> - tab
122 * C<%%> - percent sign
123
124 The syntax also allows padding and some filters. Examples:
125
126 git-codeowners show -f ' * %-50F %O' # default for "show"
127 git-codeowners show -f '%{quote}F,%{quote}O' # ad hoc CSV
128 git-codeowners patterns -f '--> %{color:0c0}T' # whatever...
129
130 Available filters:
131
132 =for :list
133 * C<quote> - Quote the replacement string.
134 * C<color:FFFFFF> - Colorize the replacement string (if color is ON).
135 * C<nocolor> - Do not colorize replacement string.
136
137 =cut
138
139 # FATPACK - Do not remove this line.
140
141 use warnings;
142 use strict;
143
144 use App::Codeowners;
145
146 our $VERSION = '9999.999'; # VERSION
147
148 App::Codeowners->main(@ARGV);
This page took 0.034179 seconds and 3 git commands to generate.