read command line arguments and get program name