Hi guys,

I was configuring a machine's slots using the UI, and getting everything "just right", with the different devices and options and then having to figure out the CLI options to launch that from a command line.

Sometimes its really difficult to get the options and names just right.

It should be possible to use the manager:machine().devices table to extract the slot options from the device tag:

Code
function printt(t) for i,j in pairs(t) do print(i,j) end end
printt(manager:machine().devices)

function match_string(a) for word in string.gmatch(a,"([%a%d_]+)") do print(word) end end
for i,j in pairs(manager:machine().devices) do print("device "..i) match_string(i) end

Code
device :sl1:parallel:pic_ctx:ap2000
sl1
parallel
pic_ctx
ap2000

which map to the options:

-sl1 parallel -sl1:parallel:pic_ctx ap2000

Of course, there's a lot of devices that aren't relevant and would need to be filtered out like:
Code
device :sl1:parallel:pic_ctx:ap2000:cr_stepper
sl1
parallel
pic_ctx
ap2000
cr_stepper

and you could inspect the images table to get the mounted floppies and hard drives:

Code
for i,j in pairs(manager:machine().images) do 
         print("device "..i) match_string(i) 
         print("filename = "..manager:machine().images[i]:filename()) 
end

device flop1
flop1
filename = /home/Downloads/ColorPrintShop.DSK



Just an idea I was playing with.