Man pages: tighter documenting of --format fields

Initial impetus was #20958 (ps --format .Label abc). This is
a complicated solution to a simple-seeming problem.

The problem: .Label is a cobra *function*, something I did not
know about nor handle.

Solution: recognize cobra functions. Switch to __complete,
not __completeNoDesc, so we can see the number of arguments
required. Invent new man-page format for documenting functions.
And, finally, start enforcing how functions (and cobra structs)
are documented.

This discovered a never-used completion function, .Recycle(),
in podman-events. Remove it.

[NO NEW TESTS NEEDED] - the .go change is an excision of dead code.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2023-12-14 11:28:30 -07:00
parent 3a46fe858f
commit dbe0e67897
17 changed files with 155 additions and 77 deletions

View File

@ -16,18 +16,18 @@ Pretty-print networks to JSON or using a Go template.
| **Placeholder** | **Description** |
|--------------------|-------------------------------------------|
| .Created | Timestamp when the network was created |
| .Created ... | Timestamp when the network was created |
| .DNSEnabled | Network has dns enabled (boolean) |
| .Driver | Network driver |
| .ID | Network ID |
| .Internal | Network is internal (boolean) |
| .IPAMOptions | Network ipam options |
| .IPAMOptions ... | Network ipam options |
| .IPv6Enabled | Network has ipv6 subnet (boolean) |
| .Labels | Network labels |
| .Labels ... | Network labels |
| .Name | Network name |
| .NetworkDNSServers | Array of DNS servers used in this network |
| .NetworkInterface | Name of the network interface on the host |
| .Options | Network options |
| .Options ... | Network options |
| .Routes | List of static routes for this network |
| .Subnets | List of subnets on this network |