You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WHAT
Allow dependent scripts to (optionally) specify how flag input should be parsed by providing callback functions at instantiation time.
Callback functions would be applied to the raw CLI input, and the resulting values would be exposed to the dependent script as normal (eg. via cli.flags).
HOW
I've stubbed out an initial implementation and test on my fork, which I'd be happy to submit for review.
NOTES
I stumbled on Issue #44after digging into this proposed update. I'm not sure what the state of that issue is, but it looks like there's at least some overlap in terms of functionality.
The text was updated successfully, but these errors were encountered:
Yeah, I think this could be useful. I would name it parse instead of callback though.
Rather than updating the API to support/parse both arrays and strings,
I think it would be useful to support an array type. The problem is that there are two conventions for specifying arrays. Either foo --array=1 --array=2 or foo --array=1,2.
The problem is that there are two conventions for specifying arrays
If both conventions are well known/understood, I think the second example (flag name appears once, followed by comma delimited values) wins out in terms of usability. Alternatively, would it be possible to support both styles?
Ifmeow is updated to support arrays, will it be possible to enforce a specific type on the values?
WHAT
Allow dependent scripts to (optionally) specify how flag input should be parsed by providing
callback
functions at instantiation time.Callback functions would be applied to the raw CLI input, and the resulting values would be exposed to the dependent script as normal (eg. via
cli.flags
).For example:
WHY
This would be useful for cases where the underlying API requires an array value for a specific option.
Rather than updating the API to support/parse both arrays and strings, the transformation could be handled directly in the CLI layer.
For example:
HOW
I've stubbed out an initial implementation and test on my fork, which I'd be happy to submit for review.
NOTES
I stumbled on Issue #44 after digging into this proposed update. I'm not sure what the state of that issue is, but it looks like there's at least some overlap in terms of functionality.
The text was updated successfully, but these errors were encountered: