Allow passing argc to EQL::ini

Current implementation only passes in the first element of argv,
breaking command line argument parsing in scripts executed by eql5.

The eql5 binary now passes all arguments, while custom code can chose
the old or new behaviour, depending on which ini form is used.
This commit is contained in:
Bernd Wachter 2020-11-11 11:32:50 +02:00
parent df13447cde
commit b85c3895b8
3 changed files with 6 additions and 1 deletions

View file

@ -50,6 +50,10 @@ void EQL::ini(char** argv) {
cl_booted = true;
cl_boot(1, argv); }
void EQL::ini(int argc, char** argv) {
cl_booted = true;
cl_boot(argc, argv); }
void EQL::eval(const char* lisp_code) {
CL_CATCH_ALL_BEGIN(ecl_process_env()) {
si_safe_eval(2, ecl_read_from_cstring((char*)lisp_code), Cnil); }

View file

@ -30,6 +30,7 @@ public:
static bool qexec;
static const char version[];
static QEventLoop* eventLoop;
static void ini(int, char**);
static void ini(char**);
static void eval(const char*);

View file

@ -55,7 +55,7 @@ int catch_all_qexec() {
int main(int argc, char** argv) {
EQL::ini(argv); // best initialized here
EQL::ini(argc, argv); // best initialized here
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); // for Qt WebEngine
QApplication qapp(argc, argv);