mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
* fix typings and missing lib * fix i18n typo, add typings * code improvements * fix missing awaits * more fixes * fix bug in the evaluators, simplify code * more fixes
37 lines
1017 B
TypeScript
37 lines
1017 B
TypeScript
/*
|
|
* Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved.
|
|
*
|
|
* License rights for this program may be obtained from Alfresco Software, Ltd.
|
|
* pursuant to a written agreement and any use of this program without such an
|
|
* agreement is prohibited.
|
|
*/
|
|
|
|
import { ParamType } from './params';
|
|
import { BaseParam, CommanderOptionParams } from './base-param';
|
|
|
|
export class InputParam extends BaseParam {
|
|
protected type = ParamType.input;
|
|
|
|
get commanderOption(): CommanderOptionParams {
|
|
const optionParams: CommanderOptionParams = [`-${this.options.alias}, --${this.options.name} <${this.options.name}>`, this.options.title];
|
|
|
|
if (this.options.processor !== undefined) {
|
|
optionParams.push(this.options.processor);
|
|
}
|
|
|
|
if (this.options.default !== undefined) {
|
|
optionParams.push(this.options.default);
|
|
}
|
|
|
|
return optionParams;
|
|
}
|
|
|
|
get inquirerOption() {
|
|
return {
|
|
type: this.type,
|
|
name: this.options.name,
|
|
message: this.options.title
|
|
};
|
|
}
|
|
}
|