factor script_command argv allocation