Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sraps opened this issue Nov 25, 2016 · 0 comments
Open

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

sraps opened this issue Nov 25, 2016 · 0 comments
Assignees
Labels

Comments

@sraps
Copy link
Contributor

sraps commented Nov 25, 2016

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

@sraps sraps added the bug label Nov 25, 2016
@sraps sraps self-assigned this Nov 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant