/*
parse args to options
*/
parse args to options
/ * parse args to options * /
func ArgToOption(s string) (string, error) {
	if len(s) < 2 || s[0] != '-' {
		return "", errors.New(fmt.Sprintf("bad flag syntax: %s", s))
	}
	numMinuses := 1
	if s[1] == '-' {
		numMinuses++
		if len(s) == 2 { 
			return "", nil
		}
	}
	name := s[numMinuses:]
	if len(name) == 0 || name[0] == '-' || name[0] == '=' {
		return name, errors.New(fmt.Sprintf("bad flag syntax: %s", s))
	}
	return name, nil
}
func ArgToOption ( s string ) ( string , error ) { if len ( s ) < 2 || s [ 0 ] != '-' { return " " , errors . New ( fmt . Sprintf ( " " , s ) ) } numMinuses := 1 if s [ 1 ] == '-' { numMinuses ++ if len ( s ) == 2 { return " " , nil } } name := s [ numMinuses : ] if len ( name ) == 0 || name [ 0 ] == '-' || name [ 0 ] == '=' { return name , errors . New ( fmt . Sprintf ( " " , s ) ) } return name , nil }
parse args to options
parse args to options
// "--" terminates the flags