Skip to content

Optional and required flags are swapped in the "Usage" message #315

@Mirandatz

Description

@Mirandatz

Running python script.py command

import fire


class Example:

    def command(self, *, arg1: bool, arg2: bool = True, arg3: bool = False):
        pass


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

Prints

ERROR: Missing required flags: {'arg1'}
Usage: download.py command <flags>
  optional flags:        --arg1
  required flags:        --arg2 | --arg3

The "ERROR" message correctly points that arg1 is required, but the "Usage" message is swapping required and optional arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions