Skip to content

Mismatched help keys and task args doesn't result in a useful error #398

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

Closed
sohaibfarooqi opened this issue Oct 19, 2016 · 2 comments · Fixed by #611
Closed

Mismatched help keys and task args doesn't result in a useful error #398

sohaibfarooqi opened this issue Oct 19, 2016 · 2 comments · Fixed by #611

Comments

@sohaibfarooqi
Copy link

sohaibfarooqi commented Oct 19, 2016

Hi,
I am trying to add help text to a task as follow: (Pyinvoke 0.13.0)

@task(help={'name': "Use --type aj and --type mp"})
      def build(ctx, type=None):
         pass

The issue is invoke --help build prints nothing in OPTIONS.
The check if name in self.help: (Line: 186) inside function def arg_opts() in invoke/tasks.py is getting failed and not value gets assigned to opts['help'] that's what i noticed. Any workaround for this issue?

@bitprophet
Copy link
Member

Hm, IIRC the keys in help need to match the arguments in the task function itself, but your key is name while your argument is type.

Just checked, and my memory is correct - you need to change 'name' in help to be 'type', and then invoke --help build should show your help text on the line for --type.

Gonna leave this open as "this should have resulted in a useful error instead of silent failure", however. Thanks for the report!

@bitprophet bitprophet changed the title Help text not getting printed. Mismatched help keys and task args doesn't result in a useful error Oct 19, 2016
haydenflinner added a commit to haydenflinner/invoke that referenced this issue Sep 22, 2018
haydenflinner added a commit to haydenflinner/invoke that referenced this issue Nov 2, 2018
florisla pushed a commit to florisla/invoke that referenced this issue Jan 7, 2019
florisla pushed a commit to florisla/invoke that referenced this issue Jan 20, 2020
@bitprophet
Copy link
Member

Fixed in #611.

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

Successfully merging a pull request may close this issue.

2 participants