Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions