Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Feb 5, 2024
1 parent 35f42d3 commit 1741d47
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Binary file added notes/terminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions packages/clide-js/src/core/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,16 @@ export function command<
// Apply defaults
requiresSubcommand = false,
isMiddleware = true,
...rest
options = {} as TOptions,
handler,
description = '',
}: CommandModule<TData, TOptions>) {
let mod = {
requiresSubcommand,
isMiddleware,
...rest,
options,
handler,
description,
};

if (!mod.handler) {
Expand Down
6 changes: 5 additions & 1 deletion packages/clide-js/src/core/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ export class Context<TOptions extends OptionsConfig = OptionsConfig> {
}: {
commands: (CommandModule<any, any> | ResolvedCommand)[];
initialData?: any;
// TODO: strict type for optionValues and paramValues
optionValues?: OptionValues;
paramValues?: Record<string, any>;
}) => {
Expand Down Expand Up @@ -388,7 +389,10 @@ export class Context<TOptions extends OptionsConfig = OptionsConfig> {
...this.options,
...resolvedCommandsOptions,
},
optionValues,
optionValues: {
...this.parsedOptions,
...optionValues,
},
});

try {
Expand Down

0 comments on commit 1741d47

Please sign in to comment.