google / python-fire

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Other
26.86k stars 1.44k forks source link

Support case-insensitive usage #426

Open dukecat0 opened 1 year ago

dukecat0 commented 1 year ago

Refers to #43

Sample usage:

import fire

class Example(object):
  def alpha(self):
    return 'alpha'
  def Alpha(self):
    return 'Alpha'
  def Beta(self):
    return 'Beta'

if __name__=='__main__':
    fire.Fire(Example)
$ python test.py alpha
alpha
$ python test.py Alpha
Alpha
$ python test.py beta
Beta
$ python test.py BETA
NOTE: Consider using the correct capitalization for BETA
ERROR: Ambiguous member access: BETA
Usage: test.py <command>
  available commands:    Alpha | Beta | alpha

For detailed information on this command, run:
  test.py --help