commands

package
v1.3.107 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package commands cmd/dmsg/dmsg/commands/root.go c1-net-dmsg

Index

Constants

This section is empty.

Variables

View Source
var DmsgptyCmd = &cobra.Command{
	Use:   "pty",
	Short: "DMSG pseudoterminal (pty)",
	Long: `
	┌─┐┌┬┐┬ ┬
	├─┘ │ └┬┘
	┴   ┴  ┴
DMSG pseudoterminal (pty)`,
	SilenceErrors:         true,
	SilenceUsage:          true,
	DisableSuggestions:    true,
	DisableFlagsInUseLine: true,
}

DmsgptyCmd is the `pty` group inside the dmsg subtree. Exported so the skywire-binary import path (cmd/skywire/commands/root.go) can mark it Hidden — the standalone `dmsg pty` paths still work from the dmsg binary, but the skywire binary surfaces the unified `app pty` tree instead.

View Source
var RootCmd = &cobra.Command{
	Use:   dmsgclient.ExecName(),
	Short: "DMSG services & utilities",
	Long: func() (ret string) {
		ret = calvin.AsciiFont("dmsg")
		if buildinfo.DBIVersion() != "" {
			ret += fmt.Sprintf("\n%v", buildinfo.DBIVersion())
		} else {
			ret += fmt.Sprintf("\nversion %v", buildinfo.Version())
		}
		if buildinfo.Go() != "unknown" && buildinfo.Go() != "" {
			ret += "\nbuilt with " + buildinfo.Go()
		}
		return ret
	}(),
	PersistentPreRun: func(_ *cobra.Command, _ []string) {
		if withKill {
			c := make(chan os.Signal, 1)
			signal.Notify(c, os.Interrupt, syscall.SIGTERM)
			go func() {
				sigCount := 0
				for range c {
					sigCount++
					if sigCount >= 3 {
						cmdutil.Exit(1)
					}
				}
			}()
		}
	},
	SilenceErrors:         true,
	SilenceUsage:          true,
	DisableSuggestions:    true,
	DisableFlagsInUseLine: true,
}

RootCmd contains all binaries which may be separately compiled as subcommands

Functions

func Execute

func Execute()

Execute executes root CLI command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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