Improved argument parsing logic that avoids missing variable warnings