summoner icon indicating copy to clipboard operation
summoner copied to clipboard

Help could show available build tools for script command

Open andys8 opened this issue 5 years ago • 1 comments

Creating a new script requires to select a BUILD_TOOL. It would be nice if the available options would be part of the help. Having a look at the source, the options are stack and cabal.

https://github.com/kowainik/summoner/blob/b56aada330f21a45054bc47c677d7112d44e411c/summoner-cli/src/Summoner/Settings.hs#L60-L63

$ summoner script
Missing: BUILD_TOOL

Usage: summoner script BUILD_TOOL [-g|--ghc=GHC_VERSION] [-n|--name=FILE_NAME]
  Create a new Haskell script
$ summoner script --help
Usage: summoner script BUILD_TOOL [-g|--ghc=GHC_VERSION] [-n|--name=FILE_NAME]
  Create a new Haskell script

Available options:
  -h,--help                Show this help text
  -g,--ghc=GHC_VERSION     Version of the compiler to be used for
                           script (default: Ghc883)
  -n,--name=FILE_NAME      Name of the script file

andys8 avatar Dec 11 '20 14:12 andys8

Thanks, this is a nice idea! The easiest way to do this is to rename the metavariable to something like BUILD_TOOL:[cabal|stack]. It can be changed here:

https://github.com/kowainik/summoner/blob/main/summoner-cli/src/Summoner/CLI.hs#L373

Feel free to open a PR if you feel like it 🙂

vrom911 avatar Dec 12 '20 14:12 vrom911