diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2020-11-12 20:32:30 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2020-11-12 21:46:17 +0100 |
commit | f5a2e578ebdcc38468fc777018099a6cc732c0f0 (patch) | |
tree | ef624856aed5e15b9bcaa198fcfa25bfb43bff89 /hack/xref-helpmsgs-manpages | |
parent | 7774f63319be64a0a96fb7ec7c9f0b7c28faac03 (diff) | |
download | podman-f5a2e578ebdcc38468fc777018099a6cc732c0f0.tar.gz podman-f5a2e578ebdcc38468fc777018099a6cc732c0f0.tar.bz2 podman-f5a2e578ebdcc38468fc777018099a6cc732c0f0.zip |
Maintain consistent order of short and long flag names in docs
Make the order of short and long flag names in the documentation
consistent. Also adjust the man page validaten script to only allow
the `**--long**, **-s**` syntax.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'hack/xref-helpmsgs-manpages')
-rwxr-xr-x | hack/xref-helpmsgs-manpages | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hack/xref-helpmsgs-manpages b/hack/xref-helpmsgs-manpages index 082cc63f2..c5447c5d6 100755 --- a/hack/xref-helpmsgs-manpages +++ b/hack/xref-helpmsgs-manpages @@ -331,8 +331,15 @@ sub podman_man { @most_recent_flags = (); # As of PR #8292, all options are <h4> and anchored if ($line =~ s/^\#{4}\s+//) { - # Handle any variation of '**--foo**, **-f**' - while ($line =~ s/^\*\*((--[a-z0-9-]+)|(-.))\*\*(,\s+)?//g) { + # If option has long and short form, long must come first. + # This is a while-loop because there may be multiple long + # option names, e.g. --net/--network + while ($line =~ s/^\*\*(--[a-z0-9-]+)\*\*(=\*[a-zA-Z0-9-]+\*)?(,\s+)?//g) { + $man{$1} = 1; + push @most_recent_flags, $1; + } + # Short form + if ($line =~ s/^\*\*(-[a-zA-Z0-9])\*\*(=\*[a-zA-Z0-9-]+\*)?//g) { $man{$1} = 1; # Keep track of them, in case we see 'Not implemented' below |