Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misaligned help text with positional arguments and numpydoc #439

Open
rezahousseini opened this issue Feb 24, 2023 · 0 comments
Open

Misaligned help text with positional arguments and numpydoc #439

rezahousseini opened this issue Feb 24, 2023 · 0 comments

Comments

@rezahousseini
Copy link

When using Numpydoc docstring style with multiple positional arguments the help text gets misaligned

import fire

def run(executable, argument):
    """Run.

    Parameters
    ----------
    executable :
            Executable to run
    argument :
            Positional argument to the executable

    """
    print("hello")

if __name__ == "__main__":
    fire.Fire(run)

When run with python test.py --help this code produces

INFO: Showing help with the command 'test.py -- --help'.

NAME
    test.py - Run.

SYNOPSIS
    test.py EXECUTABLE ARGUMENT

DESCRIPTION
    Run.

POSITIONAL ARGUMENTS
    EXECUTABLE
        Executable to run

        Positional argument to the executable
    ARGUMENT

NOTES
    You can also use flags syntax for POSITIONAL ARGUMENTS

where the help text to argument gets added to executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant