You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Issue #983 some people expressed a desire to be able to reuse commands outside of the CLI, for example in APIs and UIs. PR #1083 helped with this by removing System.exit from the commands themselves and restructuring the module so you don't have to call the main method on a command to execute it.
The following three issues still make it difficult for the commands to be reusable:
Many of the commands directly print to System.out or log to a Logger.
Many of the commands rely on side effects instead of returning a meaningful response (ex: FluoList, FluoStatus).
There's no way to set the options of a command.
The text was updated successfully, but these errors were encountered:
Since the original issue, #983, is over 2 years old I thought this issue warranted a discussion to see if it's something people still want and if people agree with my proposed solution.
For 1 and 2, we can add a public method to the command classes that returns some type of data object (or primitive if applicable). Not all commands would need this additional method. execute() can call this method and do any necessary printing. APIs and UIs can use the public method. For example FluoStatus could look like this
In Issue #983 some people expressed a desire to be able to reuse commands outside of the CLI, for example in APIs and UIs. PR #1083 helped with this by removing
System.exit
from the commands themselves and restructuring the module so you don't have to call themain
method on a command to execute it.The following three issues still make it difficult for the commands to be reusable:
System.out
or log to a Logger.FluoList
,FluoStatus
).The text was updated successfully, but these errors were encountered: