Documentation
¶
Overview ¶
Package commands cmd/dmsg/pty-cli/commands/root.go c1-net-dmsg
Package commands cmd/dmsg/pty-cli/commands/whitelist.go c1-net-dmsg
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: dmsgcli.ExecName(), Short: "DMSG pseudoterminal command line interface", Long: calvin.AsciiFont("dmsgpty-cli") + ` DMSG pseudoterminal command line interface`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, DisableFlagsInUseLine: true, PreRun: func(*cobra.Command, []string) { if _, err := os.Stat(confPath); err != nil { cli.Log.Fatalf("Config file %s not found.", confPath) } file, err := os.ReadFile(confPath) if err != nil { cli.Log.Fatalln("Unable to read ", confPath, err) } err = json.Unmarshal(file, &conf) if err != nil { cli.Log.Errorln(err) b, err := json.MarshalIndent(conf, "", " ") if err != nil { cli.Log.Fatalln("Unable to marshal conf") } err = os.WriteFile(confPath, b, 0600) if err != nil { cli.Log.Fatalln("Unable to write", confPath, err) } } conf.CLIAddr = pty.ParseWindowsEnv(conf.CLIAddr) if conf.CLIAddr != "" { cli.Addr = conf.CLIAddr } if conf.CLINet != "" { cli.Net = conf.CLINet } if remoteAddr.Port == 0 { remoteAddr.Port = pty.DefaultPort } }, RunE: func(_ *cobra.Command, _ []string) error { if _, err := buildinfo.Get().WriteTo(log.Writer()); err != nil { log.Printf("Failed to output build info: %v", err) } ctx, cancel := cmdutil.SignalContext(context.Background(), nil) defer cancel() if remoteAddr.PK.Null() { return cli.StartLocalPty(ctx, cmdName, cmdArgs...) } return cli.StartRemotePty(ctx, remoteAddr.PK, remoteAddr.Port, cmdName, cmdArgs...) }, }
RootCmd contains commands for dmsgpty-cli; which interacts with the dmsgpty-host instance (i.e. skywire-visor)
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.