Skip to content

Commit

Permalink
Improves command types
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Feb 12, 2025
1 parent bca6703 commit 5a8d8a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/cli/args/args-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import type { CliAction, LiteralUnion } from '../../core/core.models.js';
import type { CliArgumentsFetcher } from '../cli.models.js';

type ArgvResult = {
[x: string]: unknown;
_: (string | number)[];
$0: string;
readonly [x: string]: unknown;
readonly _: readonly (string | number)[];
readonly $0: string;
};

export async function argumentsFetcherAsync(): Promise<CliArgumentsFetcher> {
Expand Down
4 changes: 3 additions & 1 deletion lib/cli/cli.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export type CommandOptionNames =
| 'generateTypes'
| 'generateObjects';

export type CommandAlias = 'h';

export interface Command<TAction extends string> {
readonly name: TAction;
readonly description: string;
Expand All @@ -24,7 +26,7 @@ export interface Command<TAction extends string> {
export interface CommandOption {
readonly name: CommandOptionNames;
readonly isRequired: boolean;
readonly alias?: string;
readonly alias?: CommandAlias;
readonly description?: string;
readonly type?: 'boolean' | 'number' | 'string';
}
Expand Down

0 comments on commit 5a8d8a0

Please sign in to comment.