Closed jbboehr closed 6 years ago
Just checking, but are parameter arrays supposed to work?
import {Command, command, param, option, Options} from 'clime'; export class DefaultOptions extends Options { @option({ }) cacheTtl: number; @option({ type: String, required: true, }) output: string; } @command({ description: 'This is a command for printing a greeting message', }) export default class extends Command { async execute( @param({ type: String, description: 'extra parameters', }) args: string[], options: DefaultOptions, ) { } }
Gives me the output (at runtime) of:
$ tsc && node ./dist/src/cli.js a b ERR Expecting 1 parameter(s) at most but got 2 instead.
Hi, you may want to try params decorator instead of param.
params
param
Oops, guess I missed the s in the example.
Just checking, but are parameter arrays supposed to work?
Gives me the output (at runtime) of: