Exemplo n.º 1
0
func cmdstatus2int(s liblush.CmdStatus) (i int) {
	// not very pretty then again this entire integer status thing is bollocks
	// anyway might as well abuse it all the way
	if s.Err() != nil {
		return 3
	}
	if s.Exited() == nil {
		if s.Started() == nil {
			i = 0
		} else {
			i = 1
		}
	} else {
		if s.Success() {
			i = 2
		} else {
			i = 3
		}
	}
	return
}