Improve errors handling

* return different exit codes in various cases
* improve ``--url`` and ``--file`` options handling (were failing silently if not provided with a value)