Exemple #1
0
func (sh *Shell) parseParam(arg string) (m702.Parameter, error) {
	var p m702.Parameter
	if !strings.Contains(arg, ".") {
		return p, fmt.Errorf("cmd-motor: invalid parameter (%s)", arg)
	}
	return m702.NewParameter(arg)
}
Exemple #2
0
func parseRecord(data []string) m702.Parameter {
	p, err := m702.NewParameter(data[0])
	if err != nil {
		panic(err)
	}
	p.Title = strings.TrimSpace(data[1])
	p.DefVal = strings.TrimSpace(data[2])
	p.RW = strings.TrimSpace(data[4]) == "rw"
	return p
}