Skip to content

Instantly share code, notes, and snippets.

@amtoine
Created April 12, 2023 17:07
Show Gist options
  • Save amtoine/e3e4d75f6d0bd3b3a439077df1380421 to your computer and use it in GitHub Desktop.
Save amtoine/e3e4d75f6d0bd3b3a439077df1380421 to your computer and use it in GitHub Desktop.
a wrapper around the `gstat` plugin for `nushell`

a wrapper around the gstat plugin for nushell

this wrapper removes the 0 entries in the gstat output 👍

Note
see nu_plugin_gstat

# wrapper around the [`gstat`](https://github.com/nushell/nushell/tree/main/crates/nu_plugin_gstat) plugin
def gst [
    path: path = "."  # path to repo
    --summary (-s): bool  # remove 0 values
] {
    gstat $path | if $summary {
        transpose key value
        | where value != 0
        | transpose -r
        | into record
    } else {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment