.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "elvish-platform" "7" "Jul 18, 2021" "Elvish 0.15.0" "Miscellaneous Information Manual" .hy .SH Introduction .PP The \f[C]platform:\f[R] module provides access to the platform\[cq]s identifying data. .SH Variables .SS $platform:arch .PP The architecture of the platform; e.g. amd64, arm, ppc. This corresponds to Go\[cq]s \f[C]GOARCH\f[R] (https://pkg.go.dev/runtime?tab=doc#pkg-constants) constant. This is read-only. .SS $platform:is-unix .PP Whether or not the platform is UNIX-like. This includes Linux, macOS (Darwin), FreeBSD, NetBSD, and OpenBSD. This can be used to decide, for example, if the \f[C]unix\f[R] module is usable. This is read-only. .SS $platform:is-windows .PP Whether or not the platform is Microsoft Windows. This is read-only. .SS $platform:os .PP The name of the operating system; e.g. darwin (macOS), linux, etc. This corresponds to Go\[cq]s \f[C]GOOS\f[R] (https://pkg.go.dev/runtime?tab=doc#pkg-constants) constant. This is read-only. .SH Functions .SS platform:hostname &strip-domain=false .PP Outputs the hostname of the system. If the option \f[C]&strip-domain\f[R] is \f[C]$true\f[R], strips the part after the first dot. .PP This function throws an exception if it cannot determine the hostname. It is implemented using Go\[cq]s \f[C]os.Hostname\f[R] (https://golang.org/pkg/os/#Hostname). .PP Examples: .IP .nf \f[C] \[ti]> platform:hostname \[u25B6] lothlorien.elv.sh \[ti]> platform:hostname &strip-domain=$true \[u25B6] lothlorien \f[R] .fi