xonsh icon indicating copy to clipboard operation
xonsh copied to clipboard

Feature: Transformed captured output `$func()`

Open anki-code opened this issue 1 year ago • 0 comments

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

anki-code avatar May 02 '24 19:05 anki-code