Help with function template syntax
This is called (by me, anyway) "method chaining".

It's nothing special, really.  ArduinoOTA is just an instance of the class ArduinoOTAClass.

Each method of that class does what it needs to do, then returns a reference to the object that the method is within.  Which means that you can then call a method on that returned reference ... and so on.

All the rest of it is "lambda" functions - that is, functions that are embedded within the parameters of the functions being called.

The basic result is something like:

A.foo().bar().baz();


Where A.foo() returns A. A.bar() returns A. A.baz() returns A.

You can do the same with:

A.foo();
A.bar();
A.baz();