core icon indicating copy to clipboard operation
core copied to clipboard

[FEATURE] open xml file with core-gui from CLI

Open gh0st42 opened this issue 1 year ago • 4 comments

In old versions of coreemu (iirc <6.0) it was possible to load a scenario config directly into core-gui using the command line without using the file open dialog. This is super convenient when you have test scenarios in different repositories and are working in the terminal anyhow.

It would be nice to have a something like -f <scenario.xml> as an optional parameter for core-gui again.

gh0st42 avatar Jan 12 '24 08:01 gh0st42

This is now accomplished by the core-cli utility.

usage: core-cli xml [-h] -f FILE [-s]

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  xml file to open (default: None)
  -s, --start           start the session? (default: False)

bharnden avatar Jan 12 '24 08:01 bharnden

ah, almost forgot about core-cli for loading and starting. So I should do something core-gui -s $(core-cli xml -f scenario.xml | cut -d, -f2)? Inconvenient but is a workaround and if the CLI interface is stable can be added to my bashrc.

gh0st42 avatar Jan 12 '24 10:01 gh0st42

It doesn't plan to change at the moment. It probably should have an exit code reflective of failure or success, if that would make it an easier check. Assuming that is your goal.

That would probably be something that should be adjusted.

bharnden avatar Jan 12 '24 15:01 bharnden

no, my/our goal is just to quickly open/edit/view scenarios that we have in various repositories and projects. sometimes not even with the intent to run them directly but just to look over them, add documentation or do minor adjustments.

Of course, catching errors when opening fails should happen if multiple processes are involved now.

gh0st42 avatar Jan 13 '24 20:01 gh0st42