aeroo / aeroo_docs

Aeroo DOCS - a document conversion service
GNU General Public License v3.0
10 stars 29 forks source link

Invoking aeroo-docs without any parameter fires misleading error #23

Open sraps opened 7 years ago

sraps commented 7 years ago

Invoking aeroo-docs without any parameter fires a misleading error.

Traceback (most recent call last):
  File "./aeroo-docs", line 362, in <module>
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'

This is present on Python version 3.4.3 probably on other versions starting at 3.2.3, due to problem with argparse library. Although this is not critical error as invoking the program without any parameters is rare, there are actually several solutions to this. One of which is adding couple lines of code addind to a list of parameters a dummy '-h' parameter:

if len(sys.argv) == 1:
    sys.argv += ['-h']

before line https://github.com/aeroo/aeroo_docs/blob/master/aeroo-docs#L315