improve detection if called via command line or `require` as a module