Explicit parameter list in function documentation

Yes this. Sorry for not being clear and making assumptions in my original post.

By man-style, I mean documentation (of both C functions and shell commands) where the non-flag parameters (ie positional) are described in prose just after the signature. This is also recommended by click.

reverse X [--repeat N]

Output the reverse of the string X

OPTIONS

--repeat N   repeat the output N times

To list explicitly means to have effectively a bullet-list of all (positional and keyword etc) parameters under the signature, with a list item for each parameter (including parameter typing and description).

reverse(X, repeat=1)

Reverse a string

Args:
   X (string): string to reverse
   repeat (int): repeat the reverse string multiple times

Returns:
   string: reversed string

I disagree, I think inline style is more relevant where it doesn’t make sense to individually describe the parameters. For example, Compare the following with pow’s actual documentation:

pow(base, exp)

Exponentiate a number

Args:
   base: number to exponentiate
   exp: power to exponentiate to

Returns:
   resultant value
1 Like