project-generator / project_generator

Project generators for various embedded tools (IDE). IAR, uVision, Makefile, CoIDE, Eclipse and many more in the roadmap!
Apache License 2.0
272 stars 95 forks source link

Proper usage message output #497

Closed elfmimi closed 2 years ago

elfmimi commented 2 years ago

Executing progen without any arguments shows error message:

Traceback (most recent call last): File "/home/username/VENV/bin/progen", line 8, in sys.exit(main()) File "/home/username/VENV/lib/python3.9/site-packages/project_generator/main.py", line 70, in main return args.func(args) AttributeError: 'Namespace' object has no attribute 'func'

I suppose something like this is required

    def print_usage(args):
        parser.print_usage()
    parser.set_defaults(func=print_usage)

before this line.

https://github.com/project-generator/project_generator/blob/34d9d7b4cabd053404e8560c0479cfc6d597d1ae/project_generator/__main__.py#L51

0xc0170 commented 2 years ago

Thanks for the report, Ill check

0xc0170 commented 2 years ago

@elfmimi I am fixing some other errors today. Feel free to send a pull request, I'll review.

0xc0170 commented 2 years ago

Fixed via #501 , thanks