Skip to content

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

@sraps

Description

@sraps

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions