-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I want a transformer to process arguments/flags passed to the CLI utility. For example:
my cmd -i ./local/pathflags: {
input: {
alias: 'i',
description: 'The input source directory.',
type: 'string',
transform (value) {
return path.resolve(value)
}
}
}In the case above, the resulting "input" flag would have a value of /users/cbutler/local/path instead of ./local/path because the transformer modifies the data before it is used within a command.
This could be used for sanitizing inputs of any kind, or normalizing data (such as case sensitivity, typos, etc). It would be better to do this where the flag is defined, instead of requiring each and every command handler to do this. Currently, middleware is the only way to handle this, but that's less intuitive than a transformer.
TheSamsterZATheSamsterZA
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request