python-fire icon indicating copy to clipboard operation
python-fire copied to clipboard

help page shows unwanted information about groups

Open onprema opened this issue 4 years ago • 4 comments

I have a file called neptune that just has some standalone functions, no classes or groups.

I create my cli by doing

if __name__ == '__main__':
    fire.Fire()

When I do neptune --help, I see

Screen Shot 2019-10-11 at 1 32 24 PM

I don't understand why it says

f - "Character and line based layer over a BufferedIOBase object, buffer"

I don't want to see that information about the f group when I do neptune --help

A workaround I came up with was to do this instead

if __name__ == '__main__':
    fire.Fire({
        'cmd1': cmd1,
        'cmd2': cmd2,
        ...
    })

This doesn't seem intuitive.

I'd be happy to help fix this if someone wants to point me in the right direction!

onprema avatar Oct 11 '19 20:10 onprema

I have the same problem.

hotchilipowder avatar Dec 18 '19 10:12 hotchilipowder

Yes - confirmed I have the same issue. Documented also in #220

aaronsteers avatar Jun 26 '20 18:06 aaronsteers

Same problem here. Any update on this issue?

This is what my class looks like

class Pipeline:
    """
    Basic pipeline

    Args:
        val (str): Test value

    Attributes:
        val (str): Test value
        logger (logging.Logger): Logger object

    """

    def __init__(self, val):
        self.val = val
        self.logger = init_logger("pipe")

This is what I get when I run help command.

image

ashnair1 avatar Jun 03 '21 19:06 ashnair1

Any update on this issue?

ashnair1 avatar Jul 27 '22 11:07 ashnair1