From 6f474c57042127417048fc785ebf7b89ea09b175 Mon Sep 17 00:00:00 2001
From: Ed Santiago <santiago@redhat.com>
Date: Thu, 28 Feb 2019 15:57:32 -0700
Subject: [PATCH] Fix link inconsistencies in man pages

Found via:

    for i in docs/*.md;do x=$(perl -ne 'if (/\[(podman-.*?)\(1\)\]\((podman-.*?)\.1\.md/) { print "  $1 != $2\n" if $1 ne $2; print " ENOENT $2\n" unless -e "docs/$2.1.md" }' <$i); if [ -n "$x" ]; then echo $i; echo "$x";fi;done

...which is probably a good candidate for another CI hook,
except I have no idea how to rewrite it in awk.

Additionally, mark `podman refresh` and `podman container refresh`
as hidden, remove its man page, and remove references to it from
all other man pages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
---
 cmd/podman/refresh.go              |  1 +
 docs/podman-container-refresh.1.md | 25 -------------------------
 docs/podman-container.1.md         |  3 +--
 docs/podman-image.1.md             |  4 ++--
 docs/podman-system.1.md            |  2 +-
 docs/podman.1.md                   |  2 --
 6 files changed, 5 insertions(+), 32 deletions(-)
 delete mode 100644 docs/podman-container-refresh.1.md

diff --git a/cmd/podman/refresh.go b/cmd/podman/refresh.go
index 641748452f..193be69534 100644
--- a/cmd/podman/refresh.go
+++ b/cmd/podman/refresh.go
@@ -26,6 +26,7 @@ var (
 )
 
 func init() {
+	_refreshCommand.Hidden = true
 	refreshCommand.Command = _refreshCommand
 	refreshCommand.SetUsageTemplate(UsageTemplate())
 }
diff --git a/docs/podman-container-refresh.1.md b/docs/podman-container-refresh.1.md
deleted file mode 100644
index 26552faa66..0000000000
--- a/docs/podman-container-refresh.1.md
+++ /dev/null
@@ -1,25 +0,0 @@
-% podman-container-refresh(1)
-
-## NAME
-podman\-container\-refresh - Refresh all containers
-
-## SYNOPSIS
-**podman container refresh**
-
-## DESCRIPTION
-The refresh command refreshes the state of all containers to pick up database
-schema or general configuration changes. It is not necessary during normal
-operation, and will typically be invoked by package managers after finishing an
-upgrade of the Podman package.
-
-As part of refresh, all running containers will be restarted.
-
-## EXAMPLES ##
-
-```
-$ podman container refresh
-[root@localhost /]#
-```
-
-## SEE ALSO
-podman(1), podman-run(1)
diff --git a/docs/podman-container.1.md b/docs/podman-container.1.md
index bb27200a1b..1ba9574809 100644
--- a/docs/podman-container.1.md
+++ b/docs/podman-container.1.md
@@ -20,7 +20,7 @@ The container command allows you to manage containers
 | create     | [podman-create(1)](podman-create.1.md)              | Create a new container.                                                      |
 | diff       | [podman-diff(1)](podman-diff.1.md)                  | Inspect changes on a container or image's filesystem.                        |
 | exec       | [podman-exec(1)](podman-exec.1.md)                  | Execute a command in a running container.                                    |
-| exists     | [podman-exists(1)](podman-container-exists.1.md)    | Check if a container exists in local storage                                 |
+| exists     | [podman-container-exists(1)](podman-container-exists.1.md)  | Check if a container exists in local storage                         |
 | export     | [podman-export(1)](podman-export.1.md)              | Export a container's filesystem contents as a tar archive.                   |
 | inspect    | [podman-inspect(1)](podman-inspect.1.md)            | Display a container or image's configuration.                                |
 | kill       | [podman-kill(1)](podman-kill.1.md)                  | Kill the main process in one or more containers.                             |
@@ -30,7 +30,6 @@ The container command allows you to manage containers
 | pause      | [podman-pause(1)](podman-pause.1.md)                | Pause one or more containers.                                                |
 | port       | [podman-port(1)](podman-port.1.md)                  | List port mappings for the container.                                        |
 | prune      | [podman-container-prune(1)](podman-container-prune.1.md)| Remove all stopped containers from local storage.                        |
-| refresh    | [podman-refresh(1)](podman-container-refresh.1.md)  | Refresh the state of all containers                                          |
 | restart    | [podman-restart(1)](podman-restart.1.md)            | Restart one or more containers.                                              |
 | restore    | [podman-container-restore(1)](podman-container-restore.1.md)  | Restores one or more containers from a checkpoint.                 |
 | rm         | [podman-rm(1)](podman-rm.1.md)                      | Remove one or more containers.                                               |
diff --git a/docs/podman-image.1.md b/docs/podman-image.1.md
index 8524e50c5d..b4ae752f6e 100644
--- a/docs/podman-image.1.md
+++ b/docs/podman-image.1.md
@@ -14,7 +14,7 @@ The image command allows you to manage images
 | Command  | Man Page                                        | Description                                                                 |
 | -------- | ----------------------------------------------- | --------------------------------------------------------------------------- |
 | build    | [podman-build(1)](podman-build.1.md)            | Build a container using a Dockerfile.                                       |
-| exists   | [podman-exists(1)](podman-image-exists.1.md)    | Check if a image exists in local storage.                                   |
+| exists   | [podman-image-exists(1)](podman-image-exists.1.md) | Check if a image exists in local storage.                                |
 | history  | [podman-history(1)](podman-history.1.md)        | Show the history of an image.                                               |
 | import   | [podman-import(1)](podman-import.1.md)          | Import a tarball and save it as a filesystem image.                         |
 | inspect  | [podman-inspect(1)](podman-inspect.1.md)        | Display a image or image's configuration.                                   |
@@ -23,7 +23,7 @@ The image command allows you to manage images
 | prune    | [podman-image-prune(1)](podman-image-prune.1.md)| Removed all unused images from the local store.                             |
 | pull     | [podman-pull(1)](podman-pull.1.md)              | Pull an image from a registry.                                              |
 | push     | [podman-push(1)](podman-push.1.md)              | Push an image from local storage to elsewhere.                              |
-| rm       | [podman-rm(1)](podman-rmi.1.md)                 | Removes one or more locally stored images.                                  |
+| rm       | [podman-rmi(1)](podman-rmi.1.md)                | Removes one or more locally stored images.                                  |
 | save     | [podman-save(1)](podman-save.1.md)              | Save an image to docker-archive or oci.                                     |
 | sign     | [podman-image-sign(1)](podman-image-sign.1.md)  | Sign an image.                                                              |
 | tag      | [podman-tag(1)](podman-tag.1.md)                | Add an additional name to a local image.                                    |
diff --git a/docs/podman-system.1.md b/docs/podman-system.1.md
index d088d4d9a4..6d87648e85 100644
--- a/docs/podman-system.1.md
+++ b/docs/podman-system.1.md
@@ -13,7 +13,7 @@ The system command allows you to manage the podman systems
 
 | Command  | Man Page                                            | Description                                                                  |
 | -------  | --------------------------------------------------- | ---------------------------------------------------------------------------- |
-| info     | [podman-system-info(1)](podman-info.1.md)           | Displays Podman related system information.                                  |
+| info     | [podman-info(1)](podman-info.1.md)                  | Displays Podman related system information.                                  |
 | prune    | [podman-system-prune(1)](podman-system-prune.1.md)  | Remove all unused data                                                       |
 | renumber | [podman-system-renumber(1)](podman-system-renumber.1.md)| Migrate lock numbers to handle a change in maximum number of locks.      |
 
diff --git a/docs/podman.1.md b/docs/podman.1.md
index 43f288fd77..bc03d3c5ac 100644
--- a/docs/podman.1.md
+++ b/docs/podman.1.md
@@ -137,7 +137,6 @@ the exit codes follow the `chroot` standard, see below:
 | [podman-exec(1)](podman-exec.1.md)        | Execute a command in a running container.                                      |
 | [podman-export(1)](podman-export.1.md)    | Export a container's filesystem contents as a tar archive.                     |
 | [podman-generate(1)](podman-generate.1.md)| Generate structured data based for a containers and pods.                      |
-| [podman-help(1)](podman-history.1.md)     | Show help information on podman.                                               |
 | [podman-history(1)](podman-history.1.md)  | Show the history of an image.                                                  |
 | [podman-image(1)](podman-image.1.md)      | Manage Images.                                                                 |
 | [podman-images(1)](podman-images.1.md)    | List images in local storage.                                                  |
@@ -157,7 +156,6 @@ the exit codes follow the `chroot` standard, see below:
 | [podman-ps(1)](podman-ps.1.md)            | Prints out information about containers.                                       |
 | [podman-pull(1)](podman-pull.1.md)        | Pull an image from a registry.                                                 |
 | [podman-push(1)](podman-push.1.md)        | Push an image from local storage to elsewhere.                                 |
-| [podman-refresh(1)](podman-refresh.1.md)  | Refresh state of all containers to handle database changes.                    |
 | [podman-restart(1)](podman-restart.1.md)  | Restart one or more containers.                                                |
 | [podman-rm(1)](podman-rm.1.md)            | Remove one or more containers.                                                 |
 | [podman-rmi(1)](podman-rmi.1.md)          | Removes one or more locally stored images.                                     |