From a8316d16572f571bc09ac0374337f6a8f6a4534f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ey=C3=BE=C3=B3r=20Magn=C3=BAsson?= Date: Tue, 10 Jul 2018 14:42:57 +0200 Subject: [PATCH] fix(create-module-command): type option should be an enum --- docs/reference/commands.md | 2 +- src/commands/create/module.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/reference/commands.md b/docs/reference/commands.md index 6b346a2918..d61b108556 100644 --- a/docs/reference/commands.md +++ b/docs/reference/commands.md @@ -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 diff --git a/src/commands/create/module.ts b/src/commands/create/module.ts index 9e51c0452e..d74a63a890 100644 --- a/src/commands/create/module.ts +++ b/src/commands/create/module.ts @@ -18,6 +18,7 @@ import { StringParameter, ParameterValues, BooleanParameter, + ChoicesParameter, } from "../base" import { ParameterError, GardenBaseError } from "../../exceptions" import { availableModuleTypes, ModuleType, moduleSchema, ModuleConfigOpts } from "./config-templates" @@ -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, }), }