diff options
Diffstat (limited to 'hack')
-rwxr-xr-x | hack/markdown-preprocess | 13 | ||||
-rwxr-xr-x | hack/markdown-preprocess.t | 1 | ||||
-rw-r--r-- | hack/podman-registry-go/registry.go | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/hack/markdown-preprocess b/hack/markdown-preprocess index 68e5890d8..9cd1e9605 100755 --- a/hack/markdown-preprocess +++ b/hack/markdown-preprocess @@ -32,9 +32,6 @@ def process(infile): if '-pod-' in infile or '-kube-' in infile: pod_or_container = 'pod' - # Sometimes a man page includes the subcommand. - subcommand = podman_subcommand(infile) - # foo.md.in -> foo.md -- but always write to a tmpfile outfile = os.path.splitext(infile)[0] outfile_tmp = outfile + '.tmp.' + str(os.getpid()) @@ -57,7 +54,8 @@ def process(infile): with open(optionfile, 'r') as fh_optfile: for opt_line in fh_optfile: opt_line = replace_type(opt_line, pod_or_container) - opt_line = opt_line.replace('<<subcommand>>', subcommand) + opt_line = opt_line.replace('<<subcommand>>', podman_subcommand(infile)) + opt_line = opt_line.replace('<<fullsubcommand>>', podman_subcommand(infile, 'full')) fh_out.write(opt_line) fh_out.write("\n[//]: # (END included file " + optionfile + ")\n") else: @@ -67,10 +65,11 @@ def process(infile): os.rename(outfile_tmp, outfile) # Given a file path of the form podman-foo-bar.1.md.in, return "foo bar" -def podman_subcommand(string: str) -> str: +def podman_subcommand(string: str, full=None) -> str: # Special case: 'podman-pod-start' becomes just 'start' - if string.startswith("podman-pod-"): - string = string[len("podman-pod-"):] + if not full: + if string.startswith("podman-pod-"): + string = string[len("podman-pod-"):] if string.startswith("podman-"): string = string[len("podman-"):] if string.endswith(".1.md.in"): diff --git a/hack/markdown-preprocess.t b/hack/markdown-preprocess.t index 3cc983999..152da087b 100755 --- a/hack/markdown-preprocess.t +++ b/hack/markdown-preprocess.t @@ -71,6 +71,7 @@ class TestPodmanSubcommand(unittest.TestCase): self.assertEqual(mp.podman_subcommand("podman-foo.1.md.in"), "foo") self.assertEqual(mp.podman_subcommand("podman-foo-bar.1.md.in"), "foo bar") self.assertEqual(mp.podman_subcommand("podman-pod-rm.1.md.in"), "rm") + self.assertEqual(mp.podman_subcommand("podman-pod-rm.1.md.in", "full"), "pod rm") if __name__ == '__main__': diff --git a/hack/podman-registry-go/registry.go b/hack/podman-registry-go/registry.go index d66d092b6..30da3b6da 100644 --- a/hack/podman-registry-go/registry.go +++ b/hack/podman-registry-go/registry.go @@ -57,7 +57,7 @@ func StartWithOptions(options *Options) (*Registry, error) { // Start a registry. out, err := utils.ExecCmd(binary, args...) if err != nil { - return nil, fmt.Errorf("error running %q: %s: %w", binary, out, err) + return nil, fmt.Errorf("running %q: %s: %w", binary, out, err) } // Parse the output. @@ -112,7 +112,7 @@ func (r *Registry) Stop() error { return nil } if _, err := utils.ExecCmd(binary, "-P", r.Port, "stop"); err != nil { - return fmt.Errorf("error stopping registry (%v) with %q: %w", *r, binary, err) + return fmt.Errorf("stopping registry (%v) with %q: %w", *r, binary, err) } r.running = false return nil |