Skip to content

Implemented unified CLI interface

Benjamin Winger requested to merge bmwinger/portmod:unified_interface into master

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 becomes portmod merge
  • omwquery becomes portmod query
  • omwuse becomes portmod use
  • omwselect becomes portmod select
  • omwmirror becomes portmod mirror`
  • Additionally, omwmerge --sync has become portmod sync, and omwmerge --validate has become portmod validate
  • Update: omwmerge --search and omwmerge --searchdesc have become portmod search and portmod 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.

Edited by Benjamin Winger

Merge request reports