Re-order 'add' arguments to match our expected load order
Right now, udev-hid-bpf add $device - 00-bpf.o 10-bpf.o
loads the bpfs in the order given at the commandline. This is a common invocation if using a glob to expand the bpf files for convenience, e.g. udev-hid-bpf add $device - ./builddir/bpf/*Huion*.bpf.o
. It's also the opposite of what we do when running from udev where we do the file stem search order to reverse-load the files instead.
So we should call sort_by_stemp
on the cli args and go from there.
I'm struggling to find a use-case where we want them in lexical order except for maybe testing something but for that niche case we can add a --strict-order
argument or otherwise work around it.