Skip to content

Feature request short arguments in help text #317

@ConorSheehan1

Description

@ConorSheehan1

Saw short arguments were added in #141, which looks great!

I was wondering if it'd be possible to include the short args in help text too?

I was thinking something like, given:

# foo.py
import fire

def func(foo=False, bar='bar', baz='dupe'):
    pass

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

The output could change like this:

# python foo.py --help
 FLAGS
-    --foo=FOO
+    -f, --foo=FOO
         Default: False
     --bar=BAR
         Default: 'bar'
     --baz=BAZ
         Default: 'dupe'

I'd be happy to try and pr this myself if you think it's worth adding?

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