Skip to content

Instantly share code, notes, and snippets.

@mkatychev
Last active November 4, 2025 13:56
Show Gist options
  • Select an option

  • Save mkatychev/4bd8873f078f7984bf37f9d6609e8c6a to your computer and use it in GitHub Desktop.

Select an option

Save mkatychev/4bd8873f078f7984bf37f9d6609e8c6a to your computer and use it in GitHub Desktop.
Find + Search and Replace Nushell
def is-help []: list<any> -> bool {
('-h' in $in) or ('--help' in $in)
}
export def fd --wrapped [...$args]: nothing -> oneof<list<string>, nothing> {
if ($args | is-help) {
return (^fd ...$args)
}
^fd ...$args | lines
}
export def sd --wrapped [...args]: oneof<list<string>, nothing> -> nothing {
^sd ...$args ...$in
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment