// _search helps to do testing.
_search helps to do testing.
// _search helps to do testing .
func _search(osArgs []string) (ctx *parsingContext, invalidCmdName string, found bool) {
	cmds := state.cmds
	cmds.sort()
	ctx, hasSub := cmds.search(osArgs)
	state.parsingContext = ctx
	if ctx.cmd != nil {
		return ctx, "", true
	}
	if hasSub {
		return ctx, "", false
	}
	return ctx, ctx.getInvalidCmdName(), false
}
func _search ( osArgs [ ] string ) ( ctx * parsingContext , invalidCmdName string , found bool ) { cmds := state . cmds cmds . sort ( ) ctx , hasSub := cmds . search ( osArgs ) state . parsingContext = ctx if ctx . cmd != nil { return ctx , " " , true } if hasSub { return ctx , " " , false } return ctx , ctx . getInvalidCmdName ( ) , false }
_search helps to do testing.
_search helps to do testing .
// A command is matched exactly or is parent of the requested // command, just run the command. // There are sub commands available, don't report "command not found". // Else the requested command must be invalid.