shell-functools icon indicating copy to clipboard operation
shell-functools copied to clipboard

Support for 'flip'

Open sharkdp opened this issue 6 years ago • 2 comments

It would be great if we could apply flip to a function before we hand it over to a command. For example (suppose that % is a flip-operator):

> seq 3 | map %append "-"
-1
-2
-3

> seq 3 | filter %contains "12"
1
2

sharkdp avatar Apr 08 '18 18:04 sharkdp

It would be great if we could apply flip to a function before we hand it over to a command. For example (suppose that % is a flip-operator):

> seq 3 | map %append "-"
1-
2-
3-

With reference to the first example, if I just do seq | map append "-" - whitout flip - this is what I get:

> seq 3 | map append "-"
1-
2-
3-

I Imagine that the expect output when using flip would be:

> seq 3 | map %append "-"
-1
-2
-3

am I interpreting this in the right way?

CristianCantoro avatar Nov 09 '18 10:11 CristianCantoro

am I interpreting this in the right way?

Absolutely, thanks. I have adapted my description above.

sharkdp avatar Nov 09 '18 19:11 sharkdp