diff --git a/src/option-base.impl.ts b/src/option-base.impl.ts index cd6ec28..ac0bef7 100644 --- a/src/option-base.impl.ts +++ b/src/option-base.impl.ts @@ -59,8 +59,8 @@ export class ZOptionBase implements ZOption { return this._impl.optionLocation(init); } - supportedOptions(): Iterable { - return this._impl.optionsMeta().keys(); + supportedOptions(): readonly string[] { + return [...this._impl.optionsMeta().keys()]; } optionMeta(key: string): ZOptionMeta.Combined { diff --git a/src/option-syntax.ts b/src/option-syntax.ts index 4643966..025d293 100644 --- a/src/option-syntax.ts +++ b/src/option-syntax.ts @@ -17,7 +17,7 @@ export type ZOptionSyntax = /** * @param args An array of command line arguments to process. * - * @returns An iterable of option inputs. May be empty if the command line argument has another syntax. + * @returns A read-only array of option inputs. May be empty if the command line argument has another syntax. */ (this: void, args: readonly [string, ...string[]]) => readonly ZOptionInput[]; diff --git a/src/option.ts b/src/option.ts index fa66ddc..d498ecd 100644 --- a/src/option.ts +++ b/src/option.ts @@ -143,9 +143,9 @@ export interface ZOption { /** * Lists all options supported by the parser. * - * @returns An iterable of all supported option keys except hidden ones. + * @returns A read-only array of all supported option keys except hidden ones. */ - supportedOptions(): Iterable; + supportedOptions(): readonly string[]; /** * Returns meta information for option.