iio_readdev: Add support for automatic context detection
iio_readdev: Add support for automatic context detection

Often only a single IIO context is available on the system the application
is running on.

Add support to iio_readdev to scan for available contexts and if only one
context is found it is used automatically, otherwise a list of the
available contexts is printed. This feature is activated when the --auto
option is specified.

This makes working with devices with changing URIs more straight forward
and avoids having to call iio_info --scan to find the URI of the context.

Signed-off-by: Lars-Peter Clausen <3318dc5ce3e4fb7c28a0b841b6801c884e1d0896@metafoo.de>

analogdevicesinc/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio,analogdevicesinc/libiio