Skip to content

Ability use args, kwargs with delimiter #216

@nborisenko

Description

@nborisenko

Fire now try to parse flat args and kwargs, but often this not convenient
Example:

import fire


def test(*args, **kwargs):
    print(kwargs)
    print(args)


fire.Fire(test)

python main.py arg1 arg2 --kwarg1 1 --kwarg2 2

{'kwarg1': 1, 'kwarg2': 2} ('arg1', 'arg2')

In some cases will be much more simple have opportunity to set *args **kwargs like this :
python main.py --args arg1 --args arg2 --kwargs kwarg1=1 --kwargs kwarg2=2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions