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

Add support for return values to action methods #62

Open
TheFriendlyCoder opened this issue May 7, 2018 · 0 comments
Open

Add support for return values to action methods #62

TheFriendlyCoder opened this issue May 7, 2018 · 0 comments
Assignees
Milestone

Comments

@TheFriendlyCoder
Copy link
Owner

Currently the FShell APIs allow help methods, completion methods and alias methods to return data for use by the core APIs. However, actual action methods currently don't support any return values to speak of.

What I'd like to do here is add support for a simple "return code" value to be returned from each action method. If a method doesn't return anything we'll assume a return code of 0, and any non-zero return code will be assumed to represent some sort of error or failure condition.

For now I think it'd be best to just record this return value somehow for later reference, like for returning from the run() method, as a way of indicating to the caller that the command has not succeeded. In the most trivial case this could be used when running FShell using an input script to detect if the operations performed by the script were successful or not.

For this particular improvement I think it'd be sufficient to detect the return value from an action method, store the value from the most recent action performed in a member variable, and return that value from the run() method for future reference.

@TheFriendlyCoder TheFriendlyCoder added this to the 1.1.0 milestone May 7, 2018
@TheFriendlyCoder TheFriendlyCoder self-assigned this May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant