xonsh
xonsh copied to clipboard
Feature: Transformed captured output `$func()`
After merging #5377 I remember about old proposal. I'm not remember the author but It's interesting idea.
It will be cool to have an ability to create transformer of captured output:
json = $json(curl https://myjsonapi) # python mode, returns json object
def mytransformer(stdout):
# my transformations
return stdout
my = $mytransformer(echo 123) # python mode
echo $mytransformer(echo 123) | grep 1 # subprocess mode
For community
⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment