Skip to content

🔑 parameter documentation doesn't correctly display in help signature #259

@ntjess

Description

@ntjess

Consider the following application:

import fire

def test(a, b, **test):
  """
  Returns the operation specified on a and b.
  
  :param a: The first parameter
  :param b: The second parameter
  
  :key operation: What to do with these parameters
  """
  op = test.get('operation', sum)
  return op([a,b])
  
fire.Fire(test)

Since :key: is recognized as sphinx documentation for keyword arguments, I would expect Fire to show it similar to :param: docstrings. However, the printout ends up looking like this:

POSITIONAL ARGUMENTS
    A
        The first parameter
    B
        The second parameter

        :key operation: What to do with these parameters

Where the key is not displayed as a separate argument. Compare that to the PyCharm help signature:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions