Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unexpected Completion Behavior #148

Copy link
Copy link

Description

@tschwaller
Issue body actions

Consider the following simple example (from the docs)

#!/usr/bin/env python

import fire

def add(x, y):
  return x + y

if __name__ == '__main__':
  fire.Fire(add, name='./add.py')

The first command completion shows add and the second immediately --x --y.

This is confusing, since I would expect to see X and after I entered the first number I would expect Y or or even X Y at the very beginning so I know I have to enter 2 numbers, especially since the Usage shows

Usage:       ./add.py X Y
             ./add.py --x X --y Y

As far as I can see it is also not possible to distinguish mandatory from optional arguments. In the case above X and Yare mandatory and I would not expect to see --xand --y. An optional argument could e.g. be --modulo, which would have a default value if not used, but how to distinguish that in the Python code from the other arguments?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.