[
https://issues.apache.org/jira/browse/KARAF-5568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16327166#comment-16327166
]
ASF GitHub Bot commented on KARAF-5568:
---------------------------------------
jutzig opened a new pull request #436: [KARAF-5568] support return codes in
karaf commands
URL: https://github.com/apache/karaf/pull/436
if the return code of an Action is an integer it is
* no longer printed
* used as return code for an SSH shell
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Karaf Commands cannot have return codes
> ---------------------------------------
>
> Key: KARAF-5568
> URL: https://issues.apache.org/jira/browse/KARAF-5568
> Project: Karaf
> Issue Type: Improvement
> Components: karaf-shell
> Affects Versions: 4.1.4
> Reporter: Johannes Utzig
> Priority: Major
>
> I've been trying to implement proper return codes for my custom karaf
> commands (so they can be evaluated when called via SSH) but it seems return
> codes are currently not handled correctly.
>
> If an 'Action' returns an Integer, that integer is currently printed out on
> stdout in the local shell and ignored in an SSH shell.
> I would like to submit a pull request that introduces the following changes:
> * for SSH (ShellCommand) use the result as exitStatus if it is an integer
> * for local shell (ConsoleSessionImpl) only print out the result it is an
> instance of string
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)