Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help could show available build tools for script command #523

Open
andys8 opened this issue Dec 11, 2020 · 1 comment
Open

Help could show available build tools for script command #523

andys8 opened this issue Dec 11, 2020 · 1 comment
Labels
CLI Command line interface interaction enhancement script

Comments

@andys8
Copy link

andys8 commented Dec 11, 2020

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.

data Tool
= Cabal
| Stack
deriving stock (Show, Eq, Enum, Bounded)

$ 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
@vrom911 vrom911 added CLI Command line interface interaction enhancement script labels Dec 12, 2020
@vrom911
Copy link
Member

vrom911 commented Dec 12, 2020

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 vrom911 added this to the v2.1: Update milestone Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Command line interface interaction enhancement script
Projects
None yet
Development

No branches or pull requests

2 participants