code: func (p *Plugin) processToTemplate(pr *Process) (*process.Template, error) {
  	if pr.name == "" {
  		return nil, errors.Errorf("cannot create template from process, missing name")
  	}
  	if pr.cmd == "" {
  		return nil, errors.Errorf("cannot create template from process, missing command")
  	}
  
  	pOptions := &process.TemplatePOptions{
  		Args:    pr.options.args,
  		Restart: pr.options.restart,
  		OutWriter: func(w io.Writer) bool {
  			return w != nil
  		}(pr.options.outWriter),
  		ErrWriter: func(w io.Writer) bool {
  			return w != nil
  		}(pr.options.errWriter),
  		Detach:       pr.options.detach,
  		RunOnStartup: pr.options.runOnStartup,
  		Notify: func(notifyChan chan status.ProcessStatus) bool {
  			if notifyChan == nil {
  				return false
  			}
  			return true
  		}(pr.options.notifyChan),
  		AutoTerminate: pr.options.autoTerm,
  	}
  
  	return &process.Template{
  		Name:     pr.name,
  		Cmd:      pr.cmd,
  		POptions: pOptions,
  	}, nil
  }
docs: // Create a template object from process. A name and a command are mandatory