Make commands more easily reusable outside of CLI
- Dominant language
- Java
- Stars
- 200
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
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:
1. Many of the commands directly print to `System.out` or log to a Logger.
2. Many of the commands rely on side effects instead of returning a meaningful response (ex: `FluoList`, `FluoStatus`).
3. There's no way to set the options of a command.
Contributor guide
Research direction
Start by reading Issue #983 and PR #1083, then inspect the command module and the commands mentioned in this issue. The work is done when commands can be reused outside the CLI without direct output or logging side effects, return meaningful responses, and allow their options to be set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100