if script contains a global main function, it is called with program args