rackerlabs / fastfood

DEPRECATED
Apache License 2.0
1 stars 7 forks source link

Expand API for stencil options to support available option list #32

Closed erulabs closed 9 years ago

erulabs commented 9 years ago

Hello!

Currently, within a Stencil's manifest.json, one lists options like so:

  "options": {
    "name": {
      "help": "Name of the Node application",
      "default": "node_example.com"
    },
    "iojs": {
      "help": "Uses the IOJS fork of NodeJS instead",
      "default": "false"
    }

I have been extending this with the following information:

  "options": {
    "name": {
      "help": "Name of the Node application",
      "default": "node_example.com"
    },
    "iojs": {
      "help": "Uses the IOJS fork of NodeJS instead",
      "default": "false",
      "options": [ "true", "false" ]
    }

This allows my GUI "foodcourt" to support HTML radio-options for easy selection of available options. If no "options" flag is set, it's assumed the option is a string value.

Wondering if anyone has feedback on this - conceptually this could be consumed by Fastfood's help output to display available options. Quite useful when there are 4 or 5 specific available options for a stencil, since there is no way to easily document it now.

Thanks!

erulabs commented 9 years ago

Obviously, no changes are requested here - Just looking for feedback as this is how I'm currently extending the API and was wondering if anyone else had been thinking of something similar.

jarosser06 commented 9 years ago

What would be fastfoods job regarding those new values?

erulabs commented 9 years ago

None for now - just looking for agreement on the API expansion via the word "options" and using an array. Fastfood could show the available options when using generate, but not required.

jarosser06 commented 9 years ago

I see no problem with this.