command-line option processing, some utilities