1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 14:17:45 +00:00

added flatter, the recursive flatten script by jt

This commit is contained in:
Darren Schroeder 2021-02-10 12:46:26 -06:00
parent 84e02d71ea
commit ed6ea589ac

10
flatter.nu Normal file
View file

@ -0,0 +1,10 @@
# A command to flatten many levels by using recursion
# by @jturner 2/10/21
# Example: sys | flatter 3
def flatter [levels:int] {
if $levels > 0 {
flatten | flatter $(= $levels - 1)
} {
each { echo $it }
}
}