The docstrings of the class are passed to ArgumentParser for the usage kwarg.
import attr
from clime import clime
@attr.s(auto_attribs=True)
class Dude:
# docstrings will be taken for the ArgumentParser "usage"
"""
Amaze your friends by printing you name to the console
"""
name: str
def introduce(self):
print(f"hi! my name is {self.name}")
def main():
clime(Dude).introduce()
if __name__ == "__main__":
main()
python tutorial_001.py --help
usage:
Amaze your friends by printing you name to the console
positional arguments:
name type: <str>
optional arguments:
-h, --help show this help message and exit
Cool!
That's it... To add a usage message just add docstrings to your class