DRY up --env= query, handle deprecated methods of setting env.