Skip to content

Commit

Permalink
fix(create-module-command): type option should be an enum
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed Jul 10, 2018
1 parent eb6ee13 commit a8316d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Examples:
| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--name` | | boolean | Assigns a custom name to the module. (Defaults to name of the current directory.)
| `--type` | | string | Type of module. Check out 'https://docs.garden.io' for available types
| `--type` | | `container` `function` `npm-package` | Type of module.

### garden delete config

Expand Down
6 changes: 4 additions & 2 deletions src/commands/create/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
StringParameter,
ParameterValues,
BooleanParameter,
ChoicesParameter,
} from "../base"
import { ParameterError, GardenBaseError } from "../../exceptions"
import { availableModuleTypes, ModuleType, moduleSchema, ModuleConfigOpts } from "./config-templates"
Expand All @@ -33,8 +34,9 @@ export const createModuleOptions = {
name: new BooleanParameter({
help: "Assigns a custom name to the module. (Defaults to name of the current directory.)",
}),
type: new StringParameter({
help: "Type of module. Check out 'https://docs.garden.io' for available types",
type: new ChoicesParameter({
help: "Type of module.",
choices: availableModuleTypes,
}),
}

Expand Down

0 comments on commit a8316d1

Please sign in to comment.