os : linux mint
#!/usr/bin/python3
import click
@click.Command()
def main():
print(f"hello world")
if __name__ == "__main__":
main()
Traceback (most recent call last):
File "/home/vlad/Desktop/0/test.py", line 4, in <module>
@click.Command()
TypeError: __init__() missing 1 required positional argument: 'name'
You should use @click.command()
(with small 'c') instead of @click.Command()
. There are two separate objects. name
for the first one is optional, but the second one is a class which requires name
parameter. Check their signatures.