diff --git a/docs/source/Commands.rst b/docs/source/Commands.rst index d1bf00c589..6a81adfa89 100644 --- a/docs/source/Commands.rst +++ b/docs/source/Commands.rst @@ -13,25 +13,25 @@ Commands :doc:`commit ` Create new image based on the changed container -:doc:`container ` Manage Containers +:doc:`container ` Manage containers :doc:`cp ` Copy files/folders between a container and the local filesystem :doc:`create ` Create but do not start a container -:doc:`diff ` Inspect changes on container's file systems +:doc:`diff ` Display the changes to the object's file system -:doc:`events ` Show podman events +:doc:`events ` Show podman system events :doc:`exec ` Run a process in a running container :doc:`export ` Export container's filesystem contents as a tar archive -:doc:`export ` Farm out builds to machines running podman for different architectures +:doc:`farm ` Farm out builds to remote machines -:doc:`generate ` Generated structured data +:doc:`generate ` Generate structured data based on containers, pods or volumes -:doc:`healthcheck ` Manage Healthcheck +:doc:`healthcheck ` Manage health checks on containers :doc:`history ` Show history of a specified image @@ -45,27 +45,27 @@ Commands :doc:`init ` Initialize one or more containers -:doc:`inspect ` Display the configuration of a container or image +:doc:`inspect ` Display the configuration of object denoted by ID :doc:`kill ` Kill one or more running containers with a specific signal -:doc:`kube ` Play a pod +:doc:`kube ` Play containers, pods or volumes from a structured file -:doc:`load ` Load an image from container archive +:doc:`load ` Load image(s) from a tar archive :doc:`login ` Log in to a container registry :doc:`logout ` Log out of a container registry -:doc:`logs ` Fetch the logs of a container +:doc:`logs ` Fetch the logs of one or more containers -:doc:`machine ` Manage podman's virtual machine +:doc:`machine ` Manage a virtual machine -:doc:`manifest ` Create and manipulate manifest lists and image indexes +:doc:`manifest ` Manipulate manifest lists and image indexes :doc:`mount ` Mount a working container's root filesystem -:doc:`network ` Manage Networks +:doc:`network ` Manage networks :doc:`pause ` Pause all the processes in one or more containers @@ -89,11 +89,11 @@ Commands :doc:`run ` Run a command in a new container -:doc:`save ` Save image to an archive +:doc:`save ` Save image(s) to an archive :doc:`search ` Search registry for image -:doc:`secret ` Manage podman secrets +:doc:`secret ` Manage secrets :doc:`start ` Start one or more containers @@ -113,9 +113,11 @@ Commands :doc:`unshare ` Run a command in a modified user namespace -:doc:`untag ` Remove one or more names from a locally-stored image +:doc:`untag ` Remove a name from a local image -:doc:`version ` Display the Podman Version Information +:doc:`update ` Update an existing container + +:doc:`version ` Display the Podman version information :doc:`volume ` Manage volumes diff --git a/docs/source/volume.rst b/docs/source/volume.rst deleted file mode 100644 index af81f39bc1..0000000000 --- a/docs/source/volume.rst +++ /dev/null @@ -1,17 +0,0 @@ -Volume -====== -:doc:`create ` Create a new volume - -:doc:`exists ` Check if the given volume exists - -:doc:`export ` Exports volume to external tar - -:doc:`import ` Import tarball contents into a podman volume - -:doc:`inspect ` Display detailed information on one or more volumes - -:doc:`ls ` List volumes - -:doc:`prune ` Remove all unused volumes - -:doc:`rm ` Remove one or more volumes diff --git a/hack/xref-helpmsgs-manpages b/hack/xref-helpmsgs-manpages index 6cd1d1cd9b..627aa2e294 100755 --- a/hack/xref-helpmsgs-manpages +++ b/hack/xref-helpmsgs-manpages @@ -203,6 +203,8 @@ sub xref_by_help { OPTION: for my $k (sort keys %$help) { + next if $k =~ /^_/; # metadata ("_desc"). Ignore. + if (! ref($man)) { # Super-unlikely but I've seen it warn "$ME: 'podman @subcommand' is not documented in man pages!\n"; @@ -354,16 +356,38 @@ sub xref_by_man { ############## # xref_rst # Cross-check *.rst files against help ############## +# +# This makes a pass over top-level commands only. There is no rst +# documentation for any podman subcommands. +# sub xref_rst { - my ($help, $rst, @subcommand) = @_; + my ($help, $rst) = @_; + - # Cross-check against rst (but only subcommands, not options). # We key on $help because that is Absolute Truth: anything in podman --help - # must be referenced in an rst (the converse is not true). - for my $k (sort grep { $_ !~ /^-/ } keys %$help) { - # Check for subcommands, if any (eg podman system -> connection -> add) - if (ref $help->{$k}) { - xref_rst($help->{$k}, $rst->{$k}, @subcommand, $k); + # must be referenced in an rst (the converse is not necessarily true) + for my $k (sort grep { $_ !~ /^[_-]/ } keys %$help) { + if (exists $rst->{$k}) { + # Descriptions must match + if ($rst->{$k}{_desc} ne $help->{$k}{_desc}) { + warn "$ME: podman $k: inconsistent description in $rst->{$k}{_source}:\n"; + warn " help: '$help->{$k}{_desc}'\n"; + warn " rst: '$rst->{$k}{_desc}'\n"; + ++$Errs; + } + } + else { + warn "$ME: Not found in rst: $k\n"; + ++$Errs; + } + } + + # Now the other way around: look for anything in Commands.rst that is + # not in podman --help + for my $k (sort grep { $rst->{$_}{_source} =~ /Commands.rst/ } keys %$rst) { + if ($k ne 'Podman' && ! exists $help->{$k}) { + warn "$ME: 'podman $k' found in $rst->{$k}{_source} but not 'podman help'\n"; + ++$Errs; } } } @@ -381,7 +405,17 @@ sub podman_help { or die "$ME: Cannot fork: $!\n"; my $section = ''; while (my $line = <$fh>) { + chomp $line; + + # First line of --help is a short command description. We compare it + # (in a later step) against the blurb in Commands.rst. + # FIXME: we should crossref against man pages, but as of 2024-03-18 + # it would be way too much work to get those aligned. + $help{_desc} //= $line; + # Cobra is blessedly consistent in its output: + # [command blurb] + # Description: ... # Usage: ... # Available Commands: # .... @@ -840,14 +874,8 @@ sub podman_rst { if ($command eq 'Commands') { ; } - elsif ($command eq 'managecontainers') { - $subcommand_href = $rst{container} //= { }; - } - elsif ($command eq 'connection') { - $subcommand_href = $rst{system}{connection} //= { }; - } else { - $subcommand_href = $rst{$command} //= { }; + $subcommand_href = $rst{$command} //= { _source => $rst }; } my $previous_subcommand = ''; @@ -855,15 +883,20 @@ sub podman_rst { if ($line =~ /^:doc:`(\S+)\s+<(.*?)>`\s+(.*)/) { my ($subcommand, $target, $desc) = ($1, $2, $3); - # Check that entries are in alphabetical order + # Check that entries are in alphabetical order, and not dups if ($subcommand lt $previous_subcommand) { warn "$ME: $rst:$.: '$previous_subcommand' and '$subcommand' are out of order\n"; ++$Errs; } + if ($subcommand eq $previous_subcommand) { + warn "$ME: $rst:$.: duplicate '$subcommand'\n"; + ++$Errs; + } $previous_subcommand = $subcommand; # Mark this subcommand as documented. $subcommand_href->{$subcommand}{_desc} = $desc; + $subcommand_href->{$subcommand}{_source} = $rst; # Check for invalid links. These will be one of two forms: # -> markdown/foo.1.md @@ -873,10 +906,20 @@ sub podman_rst { warn "$ME: $rst:$.: '$subcommand' links to nonexistent $target\n"; ++$Errs; } + + my $expect = "markdown/podman-$subcommand.1"; + if ($subcommand eq 'Podman') { + $expect = "markdown/podman.1"; + } + if ($target ne $expect) { + warn "$ME: $rst:$.: '$subcommand' links to $target (expected '$expect')\n"; + ++$Errs; + } } else { if (! -e "$Docs_Path/$target.rst") { warn "$ME: $rst:$.: '$subcommand' links to nonexistent $target.rst\n"; + ++$Errs; } } } diff --git a/hack/xref-helpmsgs-manpages.t b/hack/xref-helpmsgs-manpages.t index a625f39089..af21e2aee6 100644 --- a/hack/xref-helpmsgs-manpages.t +++ b/hack/xref-helpmsgs-manpages.t @@ -130,7 +130,7 @@ $mclone->{events}{"--format"}{".Attributes"} = 0; $mclone->{events}{"--format"}{".Image"} = '...'; $mclone->{events}{"--format"}{".Status"} = 1; $hclone->{events}{"--format"}{".Status"} = '...'; -$mclone->{events}{"--format"}{".ToHumanReadable"} = 3; +$mclone->{pod}{ps}{"--format"}{".Label"} = 3; $mclone->{ps}{"--format"}{".Label"} = 0; # --format is documented, with a table, but one entry missing delete $mclone->{events}{"--format"}{".Type"}; @@ -154,11 +154,11 @@ test_xref("xref_by_help() injection", $hclone, $mclone, "'podman events --format {{.Attributes' is a nested structure. Please add '...' to man page.", "'podman events --format {{.Image' is a simple value, not a nested structure. Please remove '...' from man page.", "'podman events --format {{.Status' is a nested structure, but the man page documents it as a function?!?", - "'podman events --format {{.ToHumanReadable' is a function that calls for 1 args; the man page lists 3. Please fix the man page.", "'podman events --format ' lists '.Type', which is not in podman-events.1.md", "'podman --help' lists 'new-command-in-help', which is not in podman.1.md", "'podman partlydocumented' is not documented in man pages!", "'podman pod inspect --help' lists '-l', which is not in podman-pod-inspect.1.md", + "'podman pod ps --format {{.Label' is a function that calls for 1 args; the man page lists 3. Please fix the man page.", "'podman ps --format {{.Label' is a function that calls for 1 args. Please investigate what those are, then add them to the man page. E.g., '.Label *bool*' or '.Label *path* *bool*'", "'podman secret --help' lists 'subcommand-in-help', which is not in podman-secret.1.md", ],