2 # ABSTRACT: A tool for managing CODEOWNERS files
3 # PODNAME: git-codeowners
7 git-codeowners [--version|--help|--manual]
9 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
11 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
13 git-codeowners patterns [--format FORMAT] [--owner OWNER]
15 git-codeowners create|update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
17 # enable bash shell completion
18 eval "$(git-codeowners --shell-completion)"
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).
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.
33 Print the program name and version to C<STDOUT>, and exit.
39 Print the synopsis to C<STDOUT>, and exit.
43 You can also use C<--manual> to print the full documentation.
47 Enable colorized output.
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:
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).
58 Specify the output format to use. See L</FORMAT>.
62 =head2 --shell-completion
64 eval "$(lintany --shell-completion)"
66 Print shell code to enable completion to C<STDOUT>, and exit.
68 Does not yet support Zsh...
74 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
76 Show owners of one or more files in a repo.
80 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
84 git-codeowners patterns [--format FORMAT] [--owner OWNER]
88 git-codeowners create [REPO_DIRPATH|CODEOWNERS_FILEPATH]
90 Create a new F<CODEOWNERS> file for a specified repo (or current directory).
94 git-codeowners update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
96 Update the "unowned" list of an existing F<CODEOWNERS> file for a specified
97 repo (or current directory).
101 The C<--format> argument can be one of:
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)
112 You can specify a custom format using printf-like format sequences. These are the items that can
117 * C<%O> - Owner or owners
122 * C<%%> - percent sign
124 The syntax also allows padding and some filters. Examples:
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...
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.
139 # FATPACK - Do not remove this line.
146 our $VERSION = '9999.999'; # VERSION
148 App::Codeowners->main(@ARGV);