Closed
Description
The error message Invalid option
is confusing if the option is valid but in unexpected order.
Try 1:
$ haskell-ci github --jobs-selection any cabal.project
Invalid option `--jobs-selection'
Usage: haskell-ci github CABAL.FILE
Generate GitHub Actions config
Try 2:
$ haskell-ci github --jobs-selection=any cabal.project
Invalid option `--jobs-selection=any'
Usage: haskell-ci github CABAL.FILE
Generate GitHub Actions config
These work:
$ haskell-ci --jobs-selection=any github cabal.project
$ haskell-ci --jobs-selection any github cabal.project
$ haskell-ci github cabal.project --jobs-selection=any
$ haskell-ci github cabal.project --jobs-selection any
The command line syntax is declared as
Usage: haskell-ci (COMMAND | CABAL.FILE) [(-o|--output FILE) | --stdout]
[--config CONFIGFILE] [--cwd Dir] [----package | ----project]
[--cabal-install-version VERSION | --jobs JOBS |
--distribution DIST | --jobs-selection uniform|any |
...
--raw-travis ARG] [-V|--version]
but this syntax is apparently not followed by the command line parser; at least if the bar is to be read as usual as "alternative".
Maybe switch to https://github.com/pcapriotti/optparse-applicative ? This framework automatically generates a correct description of the command line syntax.
Metadata
Metadata
Assignees
Labels
No labels