pastel
pastel copied to clipboard
Command unable to specify a "version" option.
Hello!
I would like one of my commands to have a version
option so that users can look up a resource by an optional version ID.
I've set my options as such:
export const options = zod.object({
owner: zod.string().describe('Model owner'),
name: zod.string().describe('Model name'),
version: zod.string().optional().describe('Model version'),
silent: zod.boolean().optional().describe('Silence output'),
});
I'm noticing, however, that no matter what the user passes via --version
, the underlying app version is returned and the command never runs.
I'm not sure whether this is unexpected behavior, or something I'm doing silly. Probably the latter :) Let me know if I can provide any more detail.
Hey @mattrothenberg, yeah, version
is defined by Pastel automatically and it always prints a program version when specified. I see two options here:
-
Expose an config option for disabling a default
version
option. However, this means that CLI won't be able to display its version via-v
or--version
, which most users expect. -
Same as above, but a config option to disable
version
per command, rather than for an entire CLI. -
Disable the default
version
option when a command specifies its ownversion
, like you do. However, this is the kind of implicit behavior I usually try to avoid, but it would be the most effortless solution for you.
I'll think more about this and I'd also appreciate your thoughts on what is the ideal behavior you'd expect here 😉