premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.24k stars 618 forks source link

help and version not shown if a premake5.lua with errors is present #1508

Open marcelo-lara opened 4 years ago

marcelo-lara commented 4 years ago

What seems to be the problem? --help or --version doesn't show if there's a 'premake5.lua' with errors in the same folder

 ~/project-folder$ premake5 --help
 Error: module 'premake/my_module' not found:
    no field package.preload['premake/my_module']
    no file '/usr/local/share/lua/5.3/premake/my_module.lua'
    no file '/usr/local/share/lua/5.3/premake/my_module/init.lua'
    no file '/usr/local/lib/lua/5.3/premake/my_module.lua'
    no file '/usr/local/lib/lua/5.3/premake/my_module/init.lua'
    no file './premake/my_module.lua'
    no file './premake/my_module/init.lua'
    no file '/usr/local/lib/lua/5.3/premake/my_module.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './premake/my_module.so'
    no file '/usr/bin/premake/my_module.so'

What did you expect to happen? Help or version should be independent of the premake5.lua file

What have you tried so far? When I go back to the parent folder (without a premake5.lua) the version works as expected

~/$ premake5 --version
premake5 (Premake Build Script Generator) 5.0.0-dev

How can we reproduce this? Create or modify a premake5.lua file with a reference to a missing file module and try premake5 --version

What version of Premake are you using? 5.0.0-dev from master (as today it is https://github.com/premake/premake-core/commit/670935a23f28e28f895d072c4811437dac6fa269)

Thank you!!

smartskaft2 commented 2 years ago

I encountered this today, two years later.

Premake version:
v5.0.0-beta1, for Windows, downloaded from https://premake.github.io/download