1# Chapter 23: third-party-notices/src, two verbs again
2
3One file, shaped like cargo-gen's (chapter 21):
4
5```text
6third-party-notices generate <texts-dir> (-- <out-file> <package> <binary> <crate-dir>...)...
7third-party-notices write (<generated-file> <name>)...
8```
9
10`generate` runs in the buck build. Each `--` group is one artifact: the file
11to write, the package and binary it is for, and the crate archives linked
12into it. For each crate it reads `package.name`, `version`, `license` and
13`license-file` from the crate's `Cargo.toml`, every top-level LICENSE,
14LICENCE, COPYING or NOTICE file, and the files of a REUSE `LICENSES/`
15folder, falling back to `texts/` for the crates that ship none. Identical
16texts are written once, naming every crate that carries them. `write` copies
17the generated files into the checkout, each under its name.
18
19> **Try it.** Read the header of [main.rs](main.rs): its rules for what
20> fails the build are the reason the notices can be trusted.
21
22## For the people who maintain it
23
24| File | What |
25| --- | --- |
26| [main.rs](main.rs) | `generate` and `write`. |
27
28← Previous: [Chapter 22, third-party-notices/](../) · Up: [third-party-notices](../) · Next: [Chapter 24, record-gates/](../../record-gates/) →