elvish-platform(7)

πŸ“¦
version 0.17.0 Β· 2 versions
, in ubuntu jammy

✨ 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