// Command handles commands which control the debugger lifecycle
336712
func (d *Debugger) Command(command *api.DebuggerCommand) (*api.DebuggerState, error) {
	var err error

	if command.Name == api.Halt {
		// RequestManualStop does not invoke any ptrace syscalls, so it's safe to
		// access the process directly.
		d.log.Debug("halting")
		err = d.target.RequestManualStop()
	}

	withBreakpointInfo := true

	d.processMutex.Lock()
	defer d.processMutex.Unlock()

	d.setRunning(true)
	defer d.setRunning(false)

	switch command.Name {
	case api.Continue:
		d.log.Debug("continuing")
		err = proc.Continue(d.target)
	case api.Call:
		d.log.Debugf("function call %s", command.Expr)
		err = proc.CallFunction(d.target, command.Expr, api.LoadConfigToProc(command.ReturnInfoLoadConfig), !command.UnsafeCall)
	case api.Rewind:
		d.log.Debug("rewinding")
		if err := d.target.Direction(proc.Backward); err != nil {
			return nil, err
		}
		defer func() {
			d.target.Direction(proc.Forward)
		}()
		err = proc.Continue(d.target)
	case api.Next:
		d.log.Debug("nexting")
		err = proc.Next(d.target)
	case api.Step:
		d.log.Debug("stepping")
		err = proc.Step(d.target)
	case api.StepInstruction:
		d.log.Debug("single stepping")
		err = d.target.StepInstruction()
	case api.StepOut:
		d.log.Debug("step out")
		err = proc.StepOut(d.target)
	case api.SwitchThread:
		d.log.Debugf("switching to thread %d", command.ThreadID)
		err = d.target.SwitchThread(command.ThreadID)
		withBreakpointInfo = false
	case api.SwitchGoroutine:
		d.log.Debugf("switching to goroutine %d", command.GoroutineID)
		err = d.target.SwitchGoroutine(command.GoroutineID)
		withBreakpointInfo = false
	case api.Halt:
		// RequestManualStop already called
		withBreakpointInfo = false
	}

	if err != nil {
		if exitedErr, exited := err.(proc.ErrProcessExited); command.Name != api.SwitchGoroutine && command.Name != api.SwitchThread && exited {
			state := &api.DebuggerState{}
			state.Exited = true
			state.ExitStatus = exitedErr.Status
			state.Err = errors.New(exitedErr.Error())
			return state, nil
		}
		return nil, err
	}
	state, stateErr := d.state(api.LoadConfigToProc(command.ReturnInfoLoadConfig))
	if stateErr != nil {
		return state, stateErr
	}
	if withBreakpointInfo {
		err = d.collectBreakpointInformation(state)
	}
	for _, th := range state.Threads {
		if th.Breakpoint != nil && th.Breakpoint.TraceReturn {
			for _, v := range th.BreakpointInfo.Arguments {
				if (v.Flags & api.VariableReturnArgument) != 0 {
					th.ReturnValues = append(th.ReturnValues, v)
				}
			}
		}
	}
	return state, err
}
660205
func (cmd *Cmd) Exec() error {
	verboseLog(cmd)

	binary, err := exec.LookPath(cmd.Name)
	if err != nil {
		return &exec.Error{
			Name: cmd.Name,
			Err:  fmt.Errorf("command not found"),
		}
	}

	args := []string{binary}
	args = append(args, cmd.Args...)

	return syscall.Exec(binary, args, os.Environ())
}
334358
func Command(scriptName string, args ...string) (*exec.Cmd, error) {
	// Make sure this is a script name, not a path.
	if strings.Contains(scriptName, "/") {
		return nil, fmt.Errorf("not a script name: %v", scriptName)
	}

	// Get the list of available scripts.
	root, err := gitutil.RepositoryRootAbsolutePath()
	if err != nil {
		return nil, err
	}

	scriptsDirPath := filepath.Join(root, config.LocalConfigDirname, ScriptDirname)

	scriptsDir, err := os.Open(scriptsDirPath)
	if err != nil {
		return nil, err
	}
	defer scriptsDir.Close()

	scripts, err := scriptsDir.Readdirnames(-1)
	if err != nil {
		return nil, err
	}

	// Choose the first available script for the given script name.
	// Return a command for that script based on the file extension and platform.
	currentPlatformId := runners.ParsePlatform(runtime.GOOS)

	for _, script := range scripts {
		// To understand the loop:
		//   script     = ${base}.${ext}
		//   base       = ${name}_${platform}
		//   (=> script = ${name}_${platform}.${ext})

		// Get the file extension.
		ext := filepath.Ext(script)
		if ext == "" {
			continue
		}

		// Get the file base, i.e. the filename without the file extension.
		base := script[:len(script)-len(ext)]

		// In case the whole base matches, this is a cross-platform script and we are done.
		// Otherwise we have to parse the base further and decide what to do.
		var platformId runners.Platform
		if base == scriptName {
			platformId = currentPlatformId
		} else {
			// Split the base.
			parts := strings.Split(base, "_")

			// Make sure the platform matches the current platform.
			platform := parts[len(parts)-1]
			platformId = runners.ParsePlatform(platform)
			if platformId != currentPlatformId {
				continue
			}

			// Make sure the name matches the requested script name.
			name := base[:len(base)-len(platform)-1]
			if name != scriptName {
				continue
			}
		}

		// Get the runner for the given file extension.
		// ext contains the dot, which we need to drop.
		runner := runners.GetRunner(ext[1:], platformId)
		if runner == nil {
			continue
		}
		cmd := runner.NewCommand(filepath.Join(scriptsDirPath, script))
		cmd.Args = append(cmd.Args, args...)
		cmd.Dir = root
		return cmd, nil
	}

	return nil, &ErrNotFound{scriptName}
}
322799
func (dl *ConsoleLogger) Debug(message interface{}, params ...interface{}) {
	dl.logger.Debugf(fmt.Sprintf("%s %s", caller(), fmt.Sprint(message)), params...)
}
993899
func (a *App) Command(name string) *Command {
	for _, c := range a.Commands {
		if c.HasName(name) {
			return &c
		}
	}

	return nil
}
565388
func (a *Application) Command(name, help string) *CmdClause {
	return a.addCommand(name, help)
}
972675
func (cli *HyperClient) Cmd(args ...string) error {
	if len(args) > 1 {
		method, exists := cli.getMethod(args[:2]...)
		if exists {
			return method(args[2:]...)
		}
	}
	if len(args) > 0 {
		method, exists := cli.getMethod(args[0])
		if !exists {
			fmt.Printf("%s: '%s' is not a %s command. See '%s --help'.\n", os.Args[0], args[0], os.Args[0], os.Args[0])
			os.Exit(1)
		}
		return method(args[1:]...)
	}
	return cli.HyperCmdHelp()
}
668172
func Cmd(cf *LoggingCmdFactory) *cobra.Command {
	loggingCmd.AddCommand(getLevelCmd(cf))
	loggingCmd.AddCommand(setLevelCmd(cf))
	loggingCmd.AddCommand(revertLevelsCmd(cf))
	loggingCmd.AddCommand(getLogSpecCmd(cf))
	loggingCmd.AddCommand(setLogSpecCmd(cf))

	return loggingCmd
}
1228622
func (a *App) Cmd(runMode string) AppCmd {
	a.cmd = NewAppCmd(a.BinaryPath, a.Port, runMode, a.Paths)
	return a.cmd
}
13467
func (proto *Protocol) Command(command *Command) (reply *Reply) {
	defer func() {
		proto.lastCommand = command
	}()
	if proto.SMTPVerbFilter != nil {
		proto.logf("sending to SMTP verb filter")
		r := proto.SMTPVerbFilter(command.verb)
		if r != nil {
			proto.logf("response returned by SMTP verb filter")
			return r
		}
	}
	switch {
	case proto.TLSPending && !proto.TLSUpgraded:
		proto.logf("Got command before TLS upgrade complete")
		// FIXME what to do?
		return ReplyBye()
	case "RSET" == command.verb:
		proto.logf("Got RSET command, switching to MAIL state")
		proto.State = MAIL
		proto.Message = &data.SMTPMessage{}
		return ReplyOk()
	case "NOOP" == command.verb:
		proto.logf("Got NOOP verb, staying in %s state", StateMap[proto.State])
		return ReplyOk()
	case "QUIT" == command.verb:
		proto.logf("Got QUIT verb, staying in %s state", StateMap[proto.State])
		proto.State = DONE
		return ReplyBye()
	case ESTABLISH == proto.State:
		proto.logf("In ESTABLISH state")
		switch command.verb {
		case "HELO":
			return proto.HELO(command.args)
		case "EHLO":
			return proto.EHLO(command.args)
		case "STARTTLS":
			return proto.STARTTLS(command.args)
		default:
			proto.logf("Got unknown command for ESTABLISH state: '%s'", command.verb)
			return ReplyUnrecognisedCommand()
		}
	case "STARTTLS" == command.verb:
		proto.logf("Got STARTTLS command outside ESTABLISH state")
		return proto.STARTTLS(command.args)
	case proto.RequireTLS && !proto.TLSUpgraded:
		proto.logf("RequireTLS set and not TLS not upgraded")
		return ReplyMustIssueSTARTTLSFirst()
	case AUTHPLAIN == proto.State:
		proto.logf("Got PLAIN authentication response: '%s', switching to MAIL state", command.args)
		proto.State = MAIL
		if proto.ValidateAuthenticationHandler != nil {
			// TODO error handling
			val, _ := base64.StdEncoding.DecodeString(command.orig)
			bits := strings.Split(string(val), string(rune(0)))

			if len(bits) < 3 {
				return ReplyError(errors.New("Badly formed parameter"))
			}

			user, pass := bits[1], bits[2]

			if reply, ok := proto.ValidateAuthenticationHandler("PLAIN", user, pass); !ok {
				return reply
			}
		}
		return ReplyAuthOk()
	case AUTHLOGIN == proto.State:
		proto.logf("Got LOGIN authentication response: '%s', switching to AUTHLOGIN2 state", command.args)
		proto.State = AUTHLOGIN2
		return ReplyAuthResponse("UGFzc3dvcmQ6")
	case AUTHLOGIN2 == proto.State:
		proto.logf("Got LOGIN authentication response: '%s', switching to MAIL state", command.args)
		proto.State = MAIL
		if proto.ValidateAuthenticationHandler != nil {
			if reply, ok := proto.ValidateAuthenticationHandler("LOGIN", proto.lastCommand.orig, command.orig); !ok {
				return reply
			}
		}
		return ReplyAuthOk()
	case AUTHCRAMMD5 == proto.State:
		proto.logf("Got CRAM-MD5 authentication response: '%s', switching to MAIL state", command.args)
		proto.State = MAIL
		if proto.ValidateAuthenticationHandler != nil {
			if reply, ok := proto.ValidateAuthenticationHandler("CRAM-MD5", command.orig); !ok {
				return reply
			}
		}
		return ReplyAuthOk()
	case MAIL == proto.State:
		proto.logf("In MAIL state")
		switch command.verb {
		case "AUTH":
			proto.logf("Got AUTH command, staying in MAIL state")
			switch {
			case strings.HasPrefix(command.args, "PLAIN "):
				proto.logf("Got PLAIN authentication: %s", strings.TrimPrefix(command.args, "PLAIN "))
				if proto.ValidateAuthenticationHandler != nil {
					val, _ := base64.StdEncoding.DecodeString(strings.TrimPrefix(command.args, "PLAIN "))
					bits := strings.Split(string(val), string(rune(0)))

					if len(bits) < 3 {
						return ReplyError(errors.New("Badly formed parameter"))
					}

					user, pass := bits[1], bits[2]

					if reply, ok := proto.ValidateAuthenticationHandler("PLAIN", user, pass); !ok {
						return reply
					}
				}
				return ReplyAuthOk()
			case "LOGIN" == command.args:
				proto.logf("Got LOGIN authentication, switching to AUTH state")
				proto.State = AUTHLOGIN
				return ReplyAuthResponse("VXNlcm5hbWU6")
			case "PLAIN" == command.args:
				proto.logf("Got PLAIN authentication (no args), switching to AUTH2 state")
				proto.State = AUTHPLAIN
				return ReplyAuthResponse("")
			case "CRAM-MD5" == command.args:
				proto.logf("Got CRAM-MD5 authentication, switching to AUTH state")
				proto.State = AUTHCRAMMD5
				return ReplyAuthResponse("PDQxOTI5NDIzNDEuMTI4Mjg0NzJAc291cmNlZm91ci5hbmRyZXcuY211LmVkdT4=")
			case strings.HasPrefix(command.args, "EXTERNAL "):
				proto.logf("Got EXTERNAL authentication: %s", strings.TrimPrefix(command.args, "EXTERNAL "))
				if proto.ValidateAuthenticationHandler != nil {
					if reply, ok := proto.ValidateAuthenticationHandler("EXTERNAL", strings.TrimPrefix(command.args, "EXTERNAL ")); !ok {
						return reply
					}
				}
				return ReplyAuthOk()
			default:
				return ReplyUnsupportedAuth()
			}
		case "MAIL":
			proto.logf("Got MAIL command, switching to RCPT state")
			from, err := proto.ParseMAIL(command.args)
			if err != nil {
				return ReplyError(err)
			}
			if proto.ValidateSenderHandler != nil {
				if !proto.ValidateSenderHandler(from) {
					// TODO correct sender error response
					return ReplyError(errors.New("Invalid sender " + from))
				}
			}
			proto.Message.From = from
			proto.State = RCPT
			return ReplySenderOk(from)
		case "HELO":
			return proto.HELO(command.args)
		case "EHLO":
			return proto.EHLO(command.args)
		default:
			proto.logf("Got unknown command for MAIL state: '%s'", command)
			return ReplyUnrecognisedCommand()
		}
	case RCPT == proto.State:
		proto.logf("In RCPT state")
		switch command.verb {
		case "RCPT":
			proto.logf("Got RCPT command")
			if proto.MaximumRecipients > -1 && len(proto.Message.To) >= proto.MaximumRecipients {
				return ReplyTooManyRecipients()
			}
			to, err := proto.ParseRCPT(command.args)
			if err != nil {
				return ReplyError(err)
			}
			if proto.ValidateRecipientHandler != nil {
				if !proto.ValidateRecipientHandler(to) {
					// TODO correct send error response
					return ReplyError(errors.New("Invalid recipient " + to))
				}
			}
			proto.Message.To = append(proto.Message.To, to)
			proto.State = RCPT
			return ReplyRecipientOk(to)
		case "HELO":
			return proto.HELO(command.args)
		case "EHLO":
			return proto.EHLO(command.args)
		case "DATA":
			proto.logf("Got DATA command, switching to DATA state")
			proto.State = DATA
			return ReplyDataResponse()
		default:
			proto.logf("Got unknown command for RCPT state: '%s'", command)
			return ReplyUnrecognisedCommand()
		}
	default:
		proto.logf("Command not recognised")
		return ReplyUnrecognisedCommand()
	}
}
426916
func (s *server) Command(cmd string, args [][]byte) <-chan Result {

	if s.IsLeader() {
		cb := s.state.newCommand()
		cmdBytes := bytesForCommand(cb.originAddr, cb.reqNo, cmd, args)
		s.raft.Apply(cmdBytes, commandTimeout)
		return cb.result
	}
	// couldn't exec as leader, fallback to forwarding
	cb, err := s.dispatchToLeader(cmd, args)
	if err != nil {
		if cb != nil {
			cb.cancel()
		}
		ret := make(chan Result, 1)
		ret <- Result{nil, err}
		return ret
	}
	return cb.result
}
15490
func PortCommand(factory app.ProjectFactory) cli.Command {
	return cli.Command{
		Name:   "port",
		Usage:  "Print the public port for a port binding",
		Action: app.WithProject(factory, app.ProjectPort),
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "protocol",
				Usage: "tcp or udp ",
				Value: "tcp",
			},
			cli.IntFlag{
				Name:  "index",
				Usage: "index of the container if there are multiple instances of a service",
				Value: 1,
			},
		},
	}
}
702194
func (kvm *Clone) Command(m finn.Applier, conn redcon.Conn, cmd redcon.Command) (interface{}, error) {
	switch strings.ToLower(string(cmd.Args[0])) {
	default:
		return nil, finn.ErrUnknownCommand
	case "set":
		if len(cmd.Args) != 3 {
			return nil, finn.ErrWrongNumberOfArguments
		}
		return m.Apply(conn, cmd,
			func() (interface{}, error) {
				kvm.mu.Lock()
				kvm.keys[string(cmd.Args[1])] = cmd.Args[2]
				kvm.mu.Unlock()
				return nil, nil
			},
			func(v interface{}) (interface{}, error) {
				conn.WriteString("OK")
				return nil, nil
			},
		)
	case "get":
		if len(cmd.Args) != 2 {
			return nil, finn.ErrWrongNumberOfArguments
		}
		return m.Apply(conn, cmd, nil,
			func(interface{}) (interface{}, error) {
				kvm.mu.RLock()
				val, ok := kvm.keys[string(cmd.Args[1])]
				kvm.mu.RUnlock()
				if !ok {
					conn.WriteNull()
				} else {
					conn.WriteBulk(val)
				}
				return nil, nil
			},
		)
	case "del":
		if len(cmd.Args) < 2 {
			return nil, finn.ErrWrongNumberOfArguments
		}
		return m.Apply(conn, cmd,
			func() (interface{}, error) {
				var n int
				kvm.mu.Lock()
				for i := 1; i < len(cmd.Args); i++ {
					key := string(cmd.Args[i])
					if _, ok := kvm.keys[key]; ok {
						delete(kvm.keys, key)
						n++
					}
				}
				kvm.mu.Unlock()
				return n, nil
			},
			func(v interface{}) (interface{}, error) {
				n := v.(int)
				conn.WriteInt(n)
				return nil, nil
			},
		)
	case "keys":
		if len(cmd.Args) != 2 {
			return nil, finn.ErrWrongNumberOfArguments
		}
		pattern := string(cmd.Args[1])
		return m.Apply(conn, cmd, nil,
			func(v interface{}) (interface{}, error) {
				var keys []string
				kvm.mu.RLock()
				for key := range kvm.keys {
					if match.Match(key, pattern) {
						keys = append(keys, key)
					}
				}
				kvm.mu.RUnlock()
				sort.Strings(keys)
				conn.WriteArray(len(keys))
				for _, key := range keys {
					conn.WriteBulkString(key)
				}
				return nil, nil
			},
		)
	}
}
70389
func (b *stdBackend) processCommand(cmd *command) {
	defer cmd.close()
	switch cmd.opCode {
	case cmdReset:
		// Reset monitoring.
		b.init()
		cmd.ok()
	case cmdMeasuringPointRead:
		// Read just one measuring point.
		id := cmd.args.(string)
		if mp, ok := b.etmData[id]; ok {
			// Measuring point found.
			clone := *mp
			cmd.respond(&clone)
		} else {
			// Measuring point does not exist.
			cmd.respond(errors.New(ErrMeasuringPointNotExists, errorMessages, id))
		}
	case cmdMeasuringPointsReadAll:
		// Read all measuring points.
		resp := MeasuringPoints{}
		for _, mp := range b.etmData {
			clone := *mp
			resp = append(resp, &clone)
		}
		sort.Sort(resp)
		cmd.respond(resp)
	case cmdStaySetVariableRead:
		// Read just one stay-set variable.
		id := cmd.args.(string)
		if ssv, ok := b.ssvData[id]; ok {
			// Variable found.
			clone := *ssv
			cmd.respond(&clone)
		} else {
			// Variable does not exist.
			cmd.respond(errors.New(ErrStaySetVariableNotExists, errorMessages, id))
		}
	case cmdStaySetVariablesReadAll:
		// Read all stay-set variables.
		resp := StaySetVariables{}
		for _, mp := range b.ssvData {
			clone := *mp
			resp = append(resp, &clone)
		}
		sort.Sort(resp)
		cmd.respond(resp)
	case cmdDynamicStatusRetrieverRead:
		// Read just one dynamic status value.
		id := cmd.args.(string)
		if dsr, ok := b.dsrData[id]; ok {
			// Dynamic status found.
			v, err := dsr()
			if err != nil {
				cmd.respond(err)
			} else {
				cmd.respond(v)
			}
		} else {
			// Dynamic status does not exist.
			cmd.respond(errors.New(ErrDynamicStatusNotExists, errorMessages, id))
		}
	case cmdDynamicStatusRetrieversReadAll:
		// Read all dynamic status values.
		resp := DynamicStatusValues{}
		for id, dsr := range b.dsrData {
			v, err := dsr()
			if err != nil {
				cmd.respond(err)
			}
			dsv := &stdDynamicStatusValue{id, v}
			resp = append(resp, dsv)
		}
		sort.Sort(resp)
		cmd.respond(resp)
	}
}
937043
func Command(argv []string) int {
	deisctlMotd := prettyprint.DeisIfy("Deis Control Utility")
	usage := deisctlMotd + `
Usage: deisctl [options] <command> [<args>...]

Commands, use "deisctl help <command>" to learn more:
  config            set platform or component values
  dock              open an interactive shell on a container in the cluster
  help              show the help screen for a command
  install           install components, or the entire platform
  journal           print the log output of a component
  list              list installed components
  machines          list the current hosts in the cluster
  refresh-units     refresh unit files from GitHub
  restart           stop, then start components
  rolling-restart   perform a rolling restart of a Deis component (currently only router is supported)
  scale             grow or shrink the number of routers, registries or store gateways
  ssh               open an interactive shell on a machine in the cluster
  start             start components
  status            view status of components
  stop              stop components
  uninstall         uninstall components
  upgrade-prep      prepare a running cluster for upgrade
  upgrade-takeover  allow an upgrade to gracefully takeover a running cluster

Options:
  -h --help                   show this help screen
  --endpoint=<url>            etcd endpoint for fleet [default: http://127.0.0.1:4001]
  --etcd-cafile=<path>        etcd CA file authentication [default: ]
  --etcd-certfile=<path>      etcd cert file authentication [default: ]
  --etcd-key-prefix=<path>    keyspace for fleet data in etcd [default: /_coreos.com/fleet/]
  --etcd-keyfile=<path>       etcd key file authentication [default: ]
  --known-hosts-file=<path>   where to store remote fingerprints [default: ~/.ssh/known_hosts]
  --request-timeout=<secs>    seconds before a request is considered failed [default: 10.0]
  --ssh-timeout=<secs>        seconds before SSH connection is considered failed [default: 10.0]
  --strict-host-key-checking  verify SSH host keys [default: true]
  --tunnel=<host>             SSH tunnel for communication with fleet and etcd [default: ]
  --version                   print the version of deisctl
`
	// pre-parse command-line arguments
	argv, helpFlag := parseArgs(argv)
	// give docopt an optional final false arg so it doesn't call os.Exit()
	args, err := docopt.Parse(usage, argv, false, version.Version, true, false)

	if err != nil && err.Error() != "" {
		fmt.Println(err)
		return 1
	}

	if len(args) == 0 {
		return 0
	}

	command := args["<command>"].(string)
	setTunnel := true
	// "--help" and "refresh-units" doesn't need SSH tunneling
	if helpFlag || command == "refresh-units" {
		setTunnel = false
	}
	setGlobalFlags(args, setTunnel)
	// clean up the args so subcommands don't need to reparse them
	argv = removeGlobalArgs(argv)
	// construct a client
	c, err := client.NewClient("fleet")
	if err != nil {
		fmt.Printf("Error: %v\n", err)
		return 1
	}
	// Dispatch the command, passing the argv through so subcommands can
	// re-parse it according to their usage strings.
	switch command {
	case "list":
		err = c.List(argv)
	case "machines":
		err = c.Machines(argv)
	case "scale":
		err = c.Scale(argv)
	case "start":
		err = c.Start(argv)
	case "restart":
		err = c.Restart(argv)
	case "stop":
		err = c.Stop(argv)
	case "status":
		err = c.Status(argv)
	case "journal":
		err = c.Journal(argv)
	case "install":
		err = c.Install(argv)
	case "uninstall":
		err = c.Uninstall(argv)
	case "config":
		err = c.Config(argv)
	case "refresh-units":
		err = c.RefreshUnits(argv)
	case "ssh":
		err = c.SSH(argv)
	case "dock":
		err = c.Dock(argv)
	case "upgrade-prep":
		err = c.UpgradePrep(argv)
	case "upgrade-takeover":
		err = c.UpgradeTakeover(argv)
	case "rolling-restart":
		err = c.RollingRestart(argv)
	case "help":
		fmt.Print(usage)
		return 0
	default:
		fmt.Println(`Found no matching command, try "deisctl help"
Usage: deisctl <command> [<args>...] [options]`)
		return 1
	}
	if err != nil {
		fmt.Printf("Error: %v\n", err)
		return 1
	}
	return 0
}
217219
func (s *SSD1306Driver) command(b byte) (err error) {
	if err = s.dcDriver.DigitalWrite(0); err != nil {
		return err
	}
	err = s.connection.Tx([]byte{b}, nil)
	return err
}
753008
func (e Entrypoint) Cmd(args ...string) *exec.Cmd {
	// append the Entrypoint as argv[0]
	args = append([]string{string(e)}, args...)
	return &exec.Cmd{
		Path: exePath,
		Args: args,
		SysProcAttr: &syscall.SysProcAttr{
			Pdeathsig: syscall.SIGTERM,
		},
	}
}