Files
dotfiles/dot_config/nushell/nu_scripts/modules/formats/from-cpuinfo.nu
Cian Hughes 896af887ca Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows)
and improves grepability with neovim/telescope
2024-11-07 13:52:17 +00:00

23 lines
478 B
Nu

# Convert from contents of /proc/cpuinfo to structured data
export def "from cpuinfo" [] {
lines
| split list ''
| each {
split column ':'
| str trim
| update column1 {
get column1
| str replace -a ' ' '_'
}
| transpose -r -d
| update flags {
get flags
| split row ' '
}
| update bugs {
get bugs
| split row ' '
}
}
}