Closed
Description
Fire (v0.4.0, master) does not seem to show default values for keyword-only arguments. Consider the following example:
#!/usr/bin/env python3
import fire
def foo(*, bar=True):
print(bar)
if __name__ == '__main__':
fire.Fire(foo)
Save it as foo.py
and run python3 foo.py --help
.
Expected Output:
INFO: Showing help with the command 'foo.py -- --help'.
NAME
foo.py
SYNOPSIS
foo.py <flags>
FLAGS
--bar=BAR
Default: True
Actual Output:
INFO: Showing help with the command 'foo.py -- --help'.
NAME
foo.py
SYNOPSIS
foo.py <flags>
FLAGS
--bar=BAR
Looks like a one line change could fix this: change the return
statement here
Line 527 in 37c4305
return repr(spec.kwonlydefaults.get(flag, ''))