1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

Merge pull request #18 from fdncred/main

added flatter, the recursive flatten script by jt
This commit is contained in:
Darren Schroeder 2021-02-10 12:47:16 -06:00 committed by GitHub
commit 3a7765e320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 }
}
}