elvish-platform(7)
β¨ elvish-platform(7) β¨
okay bestie, welcome to the Miscellaneous Information Manual π this one is filed under elvish-platform, and it's genuinely the cutest little module β it's just your platform's ~identity~ πͺͺ no cap.
πΈ Introduction πΈ
The platform: module gives you access to the platform's identifying data. that's it, that's the whole vibe β it's like the group chat bio of your operating system π«Ά
π Variables π
$platform:arch {#platform:arch}
The architecture of the platform; e.g. amd64, arm, ppc. this one lines up exactly with Go's GOARCH constant β here's the link if you wanna peek: https://pkg.go.dev/runtime?tab=doc#pkg-constants π
This is read-only. like, don't even try it, she's not accepting edits π
$platform:is-unix {#platform:is-unix}
Whether or not the platform is UNIX-like. this includes Linux, macOS (Darwin), FreeBSD, NetBSD, and OpenBSD. it's giving "am I in the unix club" π
you can use this to decide, for example, if the unix module is usable. super handy iykyk.
This is read-only. β¨
$platform:is-windows {#platform:is-windows}
Whether or not the platform is Microsoft Windows. yes, this is the "is it windows" button. iconic, honestly πͺ
This is read-only. π
$platform:os {#platform:os}
The name of the operating system; e.g. darwin (macOS), linux, etc. this matches Go's GOOS constant β link right here bestie: https://pkg.go.dev/runtime?tab=doc#pkg-constants π
This is read-only. periodt. π
π¦ Functions π¦
platform:hostname {#platform:hostname}
platform:hostname &strip-domain=$false
Outputs the hostname of the system. that's your machine's little name tag π·οΈ
If the option &strip-domain is $true, it strips the part after the first dot. so you get just the short name, no domain attached. cute.
β οΈ heads up bestie: this function throws an exception if it cannot determine the hostname. no hostname, no vibes π
It's implemented using Go's os.Hostname β here's that link too: https://golang.org/pkg/os/#Hostname πΉ
Examples:
~> platform:hostname
βΆ lothlorien.elv.sh
~> platform:hostname &strip-domain=$true
βΆ lothlorien
see?? full name vs. nickname. the glow-up is real πβ¨
and that's the whole page, bestie!! you ate that π
Elvish 0.17.0 π Nov 18, 2024 β mwah, go forth and vibe check your platform ππ¦
π¦ where this page comes from
- ubuntu jammy: elvish 0.17.0-1ubuntu0.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms