Help us shape the future of Go! Take the 2026 Go Developer Survey

progname

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package progname resolves the name this binary was invoked as, so that user-facing text names the command the user actually has.

The same source ships under two names: `rysh` for the open-source build and `ry` for the closed one. Text is written with the literal "rysh"; Rewrite swaps in the real name at print time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name() string

Name reports the name this binary was invoked as, falling back to "rysh" when argv[0] is unusable. A "*.test" name (the binary `go test` builds) also falls back, so output does not depend on the test harness.

func Rewrite

func Rewrite(s string) string

Rewrite replaces the standalone word "rysh" with the invoked binary name.

Only the bare command word is replaced. Anything touching '.', '/', '-' or '_' is a filename, path or identifier and keeps its real spelling — rysh.config.yaml, ./.rysh/, /tmp/rysh/logs/, rysh.lock, rysh-cli.

Two further spellings are left alone because they are not the binary:

[rysh]    the prefix tagging output as coming from the multiplexer
##rysh    the in-session system command, named the same in both builds

'[' and '#' are not name characters, so the boundary rules alone would have replaced these; taggedForm excludes them explicitly.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL