Requested by Kyle Burton, Ryan Michael and Andrew Montalenti.
There have been some requests to allow lemur to be used as a library instead of a CLI just tool.
Roughly, this is the work effort:
- CLI wrapper.
Solution: Move the -main fn from lemur.core into a new namespace (e.g. lemur.tool) and change the shell script bin/lemur to use the new namespace.
- The lemur.command-line/quit function does an actual System/exit.
Solution: Make it throw an Exception instead; and have the lemur.tool wrapper catch the Exception and do System/exit with the error message.
- And the key problem: lemur.core manages a bunch of state in a global atom (not a great practice, but I didn't know any better Clojure patterns at the time). It's not really a problem for command line, but if you start to use it as a lib, there will be conflicts when multiple jobs are submitted.
Solution: Create a context object and change functions that use the global context to accept an extra arg instead. This should only impact the lemur.core namespace.
Requested by Kyle Burton, Ryan Michael and Andrew Montalenti.
There have been some requests to allow lemur to be used as a library instead of a CLI just tool.
Roughly, this is the work effort:
Solution: Move the -main fn from lemur.core into a new namespace (e.g. lemur.tool) and change the shell script bin/lemur to use the new namespace.
Solution: Make it throw an Exception instead; and have the lemur.tool wrapper catch the Exception and do System/exit with the error message.
Solution: Create a context object and change functions that use the global context to accept an extra arg instead. This should only impact the lemur.core namespace.