Giter Club home page Giter Club logo

Comments (5)

johnnovak avatar johnnovak commented on June 9, 2024 3

Ok, my thoughts:

Current behaviour

I've added echo global.conf to the autoexec section of the primary conf, then a.conf contains echo "a.conf", and b.conf has echo "b.conf". The local dosbox.conf contains echo "dosbox.conf".

dosbox -c 'echo "c1"' --conf a.conf -c 'echo "c2"' --conf b.conf -c 'echo "c3"'
image

So the command execution order is:

  • -c args in order as specified
  • [autoexec] of the global config
  • [autoexec] of the local dosbox.conf config
  • [autoexec] of the --conf args in order as specified

Proposed behaviour

Given the same command:

dosbox -c 'echo "c1"' --conf a.conf -c 'echo "c2"' --conf b.conf -c 'echo "c3"'

We could execute things in the order they appear in the command line, so:

  • [autoexec] of the global config
  • [autoexec] of the local dosbox.conf config
  • -c 'echo "c1"'
  • --conf a.conf
  • -c 'echo "c2"'
  • --conf b.conf
  • -c 'echo "c3"'

I find executing anything before the global and local configs very questionable, so ideally I'd always execute the global config first followed by the local config.

Not sure what this would break though... Probably there will be at least one guy who's super upset about this (like always 😄), but does it matter? Unless a large number of people depend on running stuff before the global & local configs, I think this is a better, more logical and more flexible solution.

from dosbox-staging.

johnnovak avatar johnnovak commented on June 9, 2024

Seem reasonable. Not too sure if this would cause regressions we'd need to worry about. Probably not.

from dosbox-staging.

QmwJlHuSg9pa avatar QmwJlHuSg9pa commented on June 9, 2024

If I understand this change correctly, then I would personally find it objectionable. I am currently passing DOS environment variables to be fed into if %VAR%=1 gotos within the autoexec script. The resulting gotos can achieve much more functionality than just explicitly specifing an EXE to run. If the commands were set after the script, then I think I would lose this functionality?

E.g. in the form: "Eradicator -- Multiplayer (Host)" dosbox -conf dosbox-ERAD.conf -c set RUNSERVER=1 --set ipx=true

from dosbox-staging.

johnnovak avatar johnnovak commented on June 9, 2024

Well, I think it's more sensible to run any commands specified in the command line after all configs have been loaded. It's just common sense.

Otherwise, there would be no end to the special requests. E.g., you want the command to be executed before loading any configs @QmwJlHuSg9pa. But what if you specify two or more config files, then want to execute some commands in the middle somewhere? 😄

I'm leaning towards executing commands after all configs have been loaded. If someone wants to parametrise the config files like you @QmwJlHuSg9pa, you can always write it programmatically (or manually), then specify multiple -conf args which will be executed in order. E.g.:

dosbox --conf one-var-setup.conf --conf one.conf --conf three.conf

from dosbox-staging.

johnnovak avatar johnnovak commented on June 9, 2024

Another option, we literally run things in order. So the order of -c and --conf params is respected. Probably that's the best solution, but can be fiddly to implement. Or maybe not 🤷🏻 😆

from dosbox-staging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.