roman / Haskell-etc

Declarative configuration spec for Haskell projects
MIT License
47 stars 7 forks source link

Trouble running examples #38

Closed locallycompact closed 6 years ago

locallycompact commented 6 years ago

Hi when I build the examples and try to run them I get the following.

[lc@ashenvale etc-plain-example]$ etc-plain-example -u foo -p foo
etc-plain-example: InvalidConfiguration Nothing "Error in $['etc/entries'].credentials.cli: cli option contains invalid key \"type\""

Thanks

roman commented 6 years ago

Oh, that was because of a change was done to the spec parser a few releases ago. This is easy to fix, we just need to move the type entry from inside the cli sub-map to the upper level, e.g.:

      etc/spec:
        default: "root"
        env: "MY_APP_USERNAME"
        cli:
          input: "option"
          short: "u"
          metavar: "USERNAME"
          help: "Username of the system"
          type: "string"
          required: false

to

      etc/spec:
        default: "root"
        type: "string"
        env: "MY_APP_USERNAME"
        cli:
          input: "option"
          short: "u"
          metavar: "USERNAME"
          help: "Username of the system"
          required: false

Note where the type attribute has gone.

Can you help me creating a new PR with those changes? I can do that later if you don't have time, thanks for reporting! 🙏

locallycompact commented 6 years ago

https://github.com/roman/Haskell-etc/pull/40