I'm very used to being able to easily open files from the command line in my favourite editor, and for multiple reasons this habit has become ingrained in my workflow. I'd like to be able to do this with Code::Blocks as well, but I'm running headfirst into a brick wall here.
The help page for the executable offers the --file= command line option, but this only allows you to provide a single file. When adding the command line option twice, only the last file is opened. I could write a batch script to take all my command line arguments and run the codeblocks.exe executable for each separately. This works like a charm IFF Code::Blocks is already running. If a new instance has to be started, only the first file is opened...
Second, I noticed you can add multiple files on the commandline without --file=. This resulted in a very odd problem. If I open a file like this, then close it (the file; not Code::Blocks), then open another file, both files now get opened. If I close the two files and open a third file like this, Code::Blocks opens all three previously thusly-opened files!
The only way to get Code::Blocks to forget about the files opened this way appears to be to completely close the program. Clearly this is not what I want either.
To add insult to injury, the Windows Explorer has no trouble doing what I want at all. Click single files, multiple files, it'll always open them correctly without re-opening previously opened files. Of course, in Windows 10, it seems entirely impossible to verify how the Explorer communicates with the programs it launches (or at least the option is very well hidden), so this doesn't help me at all.
So to reiterate, here is the question:
How do I correctly open multiple files in Code::Blocks from the command line?
Thanks!