@jamcultur The command line flags set the devices to use when Pd is started. They can be used in Pd preferences to fix the devices without opening the midi dialog and saving the setup after starting Pd.
Not so useful in Pd preferences as they will always be the same, they are very useful if starting Pd from a batch file in windows, as you can have different setups for different hardware setups....... e.g. in the studio or out at a venue.
I am not sure how they could be used in Linux... maybe starting Pd from a shell script.
However, the order of devices almost definitely depends on the order in which they were plugged in before starting Pd so it needs some rigour to use -midioutdev. Using -midiaddindev and -midiaddoutdev rather than -midiindev and -midioutdev might solve that... ? I don't know the syntax..... but maybe a list of the devices by name and in the correct order after the flag...?
That could be problematic because of spaces in the device names.... see below.
I see elsewhere that you have a problem having to re-start Pd when plugging in more midi devices.
I wonder whether a request could be made to the Pd-list.
In Pd-extended devices were hot-connected when plugged in, but that is no longer the case in Vanilla. The midi-dialog.tcl file is completely different in the two versions and depends on other .tcl files and probably also on the Pd binary, so midi-dialog.tcl cannot be simply replaced.
There is also a fixed limit of 9 midi devices. I think windows has a limit of 10, and the registry needs to be edited by removing an old entry before adding a new one.
There are ways to set devices from within a patch using [midisettings]........ see set_midi-order.pd.... midisettings.zip
The idea is to reset the order of devices to what is required, by sending a list to Pd (a midi-dialog list).
It will need some work, using [midisettings] (part of the mediasettings external) as the names returned by the [listdevices( message are symbols with spaces inside. Since some version of vanilla the spaces can be escaped so the complete symbol can be used in the route object.... https://forum.pdpatchrepo.info/topic/13506/list-comparison/2
Otherwise, for older vanilla you will need [concat] which is in the thread.
So get the midi device names with their order numbers, and then re-order the numbers by device name according to what you require, and then send the re-ordered numbers back to Pd in a [midi-dialog( message.
When you implement that it will no longer matter in what order you plug the devices or in what order they appear in the midi settings menu when you start Pd.
Here is a quick re-write of set_midi-order.pd escaping spaces with a backslash for midi devices on my system....... set_midi-order.pd

The same can be achieved for audio devices using the [audio-dialog( message and [audiosettings].
David.