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

Make completion depth adjustable

Open TomerBG2 opened this issue 5 years ago • 5 comments

When running widget -- --completion you can't control the depth variable. Currently it's set to 3 by default and you cant change it using the CLI.

TomerBG2 avatar Jun 12 '20 08:06 TomerBG2

Hi @TomerBG2, What is your use case for wanting to adjust the depth?

dbieber avatar Jun 12 '20 17:06 dbieber

Hi @dbieber , When using fire (with entry point) on an object consisting of a lot of sub-objects, the generated bash completion stops at the depth of 3. So lets say I have the following:

A
    B
        C
            D
                E
                    get_x()
                    set_x(val)

Currently you only get tab completion until the C object, after that you have press enter and see what commands are available. I can think of two ways to solve this issue, using the interactive shell but this way it's not an entry point script anymore, or making the depth variable configurable upon running the --completion option.

I've opened a pull request, https://github.com/google/python-fire/pull/267

TomerBG2 avatar Jun 12 '20 19:06 TomerBG2

Hi @dbieber!

Any updates on this issue? Thanks! :)

DvirB10 avatar Jun 30 '20 08:06 DvirB10

Hello @dbieber, is there any chance to merge https://github.com/google/python-fire/pull/267 soon? Thanks!

asafkahlon avatar Jul 10 '20 06:07 asafkahlon

@dbieber Any updates on this?

TomerBG2 avatar Sep 17 '20 07:09 TomerBG2