diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-08-16 13:01:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 13:01:59 +0000 |
commit | 311b5946f74c94c5d6024c904abf6976c75e4d8f (patch) | |
tree | c47c63aa035067d7ccb1b6890231e4ec7d8207fd /hack/markdown-preprocess | |
parent | d36f3952d4f4f05d8411ad3d14e9d5b6c1814701 (diff) | |
parent | 22f3dd4c29de5be5338bdd33a8adbd201e98790d (diff) | |
download | podman-311b5946f74c94c5d6024c904abf6976c75e4d8f.tar.gz podman-311b5946f74c94c5d6024c904abf6976c75e4d8f.tar.bz2 podman-311b5946f74c94c5d6024c904abf6976c75e4d8f.zip |
Merge pull request #15331 from edsantiago/docs_dedup_piecemeal
Man pages: refactor common options: arch
Diffstat (limited to 'hack/markdown-preprocess')
-rwxr-xr-x | hack/markdown-preprocess | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/hack/markdown-preprocess b/hack/markdown-preprocess index 86667a32d..68e5890d8 100755 --- a/hack/markdown-preprocess +++ b/hack/markdown-preprocess @@ -68,6 +68,9 @@ def process(infile): # Given a file path of the form podman-foo-bar.1.md.in, return "foo bar" def podman_subcommand(string: str) -> str: + # Special case: 'podman-pod-start' becomes just 'start' + if string.startswith("podman-pod-"): + string = string[len("podman-pod-"):] if string.startswith("podman-"): string = string[len("podman-"):] if string.endswith(".1.md.in"): @@ -89,8 +92,8 @@ def replace_type(line: str, type: str) -> str: # conceivably be present in both sides. And we check for 'pod', # not 'container', because it's possible to have something like # <<container in pod|container>>. - if re.match('pod([^m]|$)', lhs, re.IGNORECASE): - if re.match('pod([^m]|$)', rhs, re.IGNORECASE): + if re.match('.*pod([^m]|$)', lhs, re.IGNORECASE): + if re.match('.*pod([^m]|$)', rhs, re.IGNORECASE): raise Exception("'%s' matches 'pod' in both left and right sides" % matchobj[0]) # Only left-hand side has "pod" if type == 'pod': @@ -98,14 +101,14 @@ def replace_type(line: str, type: str) -> str: else: return rhs else: - if not re.match('pod([^m]|$)', rhs, re.IGNORECASE): + if not re.match('.*pod([^m]|$)', rhs, re.IGNORECASE): raise Exception("'%s' does not match 'pod' in either side" % matchobj[0]) if type == 'pod': return rhs else: return lhs - return re.sub('<<[^\|>]+\|[^\|>]+>>', replwith, line) + return re.sub('<<[^\|>]*\|[^\|>]*>>', replwith, line) if __name__ == "__main__": main() |