Closed chrisdone closed 9 years ago
This library can also expose the means to find plugins (via a Text
string) and execute them, returning a status code at the end. Then the main stackage
binary (#3) has little work to do. This will be handy for plugins that call other plugins. To be clear: Given the dynamic nature of whether plugins are available or not, it should be treated as a Text lookup, not as a static import of a library.
Remaining items:
@DanBurton I fixed item one in https://github.com/fpco/stackage-cli/commit/e91fcf275f88c93eeb2ea11da22730c522d22302 and 220ae05. I think you're good on the second point.
Running commands via Stackage.CLI.runStackagePlugin
allows stdin/stdout interaction. In the repo's current state, I can build and correctly interact with the stackage purge
command.
Should be ready to close.
Confirmed in purge
Make a small library in the .cabal
stackage-cli
package with a moduleStackage.CLI
which exports a wrapper to optparse-applicative or similar with a preconfigured way of listing a summary (--summary
probably) line of help.Then the main executable can import this module to determine the correct prefix (
--summary
probably) to pass to the plugin commands to get a line for its--help
display.