main: add options handling and device/path recognition