Improved command-line option handling