Command-line and file input processing