Implemented unified CLI interface
Fixes #118 (closed)
omwmerge
, omwquery
, omwuse
, omwselect
and omwmirror
have been merged into a single portmod
executable, with subcommands for what were previously separate executables.
-
omwmerge
becomesportmod merge
-
omwquery
becomesportmod query
-
omwuse
becomesportmod use
-
omwselect
becomesportmod select
-
omwmirror becomes
portmod mirror` - Additionally,
omwmerge --sync
has becomeportmod sync
, andomwmerge --validate
has becomeportmod validate
-
Update:
omwmerge --search
andomwmerge --searchdesc
have becomeportmod search
andportmod search --description
, respectively.
Internally, this restructures all the CLI code into a portmod._cli
module. This code is not going to be part of the public api as there's little reason for other software to interact directly with the CLI functions.
It's worth noting that, to speed things up, we don't construct the entire argument parser every time (noting that the select parser needs to get module information to be able to parse arguments, so it's very slow compared to other parts of the interface), and instead we pre-process with a version of the parser that ignores arguments it doesn't recognize to figure out which subcommand is being used. Then that subcommand is added to the parser and the arguments are re-processed.
This will break the openmw-mods repo's CI (and any automated jobs relying on the existence of these executables), however for the moment it will be working off the latest release anyway, so we don't need to worry about that until the next release.
These changes mean that several places in the documentation (everywhere a command is referenced) will need to be modified. It might be worth waiting until #177 (closed) is finished though, as that will also change the interface a little bit more.