From 275893f40bd841969dd5a03a42a7b33c2e9c797a Mon Sep 17 00:00:00 2001 From: Eli Flanagan Date: Mon, 1 Nov 2021 11:50:33 -0400 Subject: [PATCH] finish example thanks to fdncred Pure gold: https://github.com/nushell/nu_scripts/pull/104#issuecomment-956335793 --- ls_mods/ls-hidden.nu | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ls_mods/ls-hidden.nu b/ls_mods/ls-hidden.nu index 529cb84..94eee72 100644 --- a/ls_mods/ls-hidden.nu +++ b/ls_mods/ls-hidden.nu @@ -1 +1,6 @@ -ls -a | where | { each { echo $it.name | str starts-with '.'} } \ No newline at end of file + +def ls-hidden [ + --dir(-d):any # The directory you want to list +] { + ls -a $dir | where { ($it.name | into string | str starts-with '.') } +}