diff --git a/lib/InteractiveOptions.ts b/lib/InteractiveOptions.ts index f48b6ac..c55b5e2 100644 --- a/lib/InteractiveOptions.ts +++ b/lib/InteractiveOptions.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-process-exit */ +/* eslint-disable no-console */ /* * Copyright (C) Sapphirecode - All Rights Reserved * This file is part of console-app which is released under MIT. @@ -38,24 +40,40 @@ interface OptionProcess extends Option { value?: unknown; } +function get_string_type (type: OptionType): 'string'|'number'|'boolean' { + if ([ + 'string', + 'number', + 'boolean' + ].includes (type)) + return type as ('string'|'number'|'boolean'); + if ([ + 'file', + 'folder', + 'path' + ].includes (type)) + return 'string'; + throw new Error (`unknown option type ${type}`); +} + export class InteractiveOptions extends Persistent { protected options: Array; + protected quiet = false; public constructor (options: Array