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

Plugin Functions: Return Value on Success #1393

Closed
sanssecours opened this issue Feb 28, 2017 · 4 comments
Closed

Plugin Functions: Return Value on Success #1393

sanssecours opened this issue Feb 28, 2017 · 4 comments

Comments

@sanssecours
Copy link
Member

πŸ‘‹ Hi,

the documentation states that elektraPluginGet should return 0 on success, yet the template suggests – since commit πŸ“œ 062e017 – that plugin functions should return 1 on success.

Other plugins also use 1 to show that functions were successful, as far as I can tell. The tcl plugin on the other hand returns 0 on success. Which return value is the correct one?

@tom-wa
Copy link
Contributor

tom-wa commented Feb 28, 2017

both are correct
1 for success + keyset updated
0 for success but nothing changed
-1 for error

@sanssecours
Copy link
Member Author

both are correct…

Thank you for the quick response. I will update the documentation accordingly.

@Namoshek
Copy link
Contributor

Namoshek commented Feb 28, 2017

I suggest to also add a note to the template, because it is trivial enough to not require to dive into a huge documentation:

//  1 for success + keyset updated
//  0 for success without changes
// -1 for error
return 1;

@sanssecours
Copy link
Member Author

I suggest to also add a note to the template, because it is trivial enough to not require to dive into a huge documentation…

Good idea. I just added the information to elektraTemplateGet in my local branch of the repo.

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

No branches or pull requests

3 participants