Move shell completion to the mvt command and generate one script for every MVT command

Setting up shell completion had nothing to do with the acquisition of one
platform, yet it was a command of mvt-ios and mvt-android, each
generating the script of the program it ran under only. Completion now
leaves the platform CLIs for mvt, which emits one script covering mvt,
mvt-ios and mvt-android, installed as a single file loaded when the shell
starts. Click names the completion function of each program after the
program, so the three scripts concatenate without colliding, and fish
takes the file in conf.d rather than one named after a single command.

With one script there is nothing left for the platform commands to
generate, so their completion command goes, and with it the banner
suppression which was keyed on the command name: mvt-ios and mvt-android
now print the banner for every command they have.

The long help line says which commands the completion covers, so a
short_help keeps "mvt --help" from truncating it.
This commit is contained in:
Donncha Ó Cearbhaill
2026-08-26 12:43:12 +02:00
parent 6070fc06fb
commit 36d1b27c4c
9 changed files with 187 additions and 185 deletions
+5 -4
View File
@@ -68,10 +68,11 @@ rather than in MVT's own `config.yaml`.
### Commands on `mvt`
The `mvt` command hosts what belongs to neither platform: `version` and
`download-iocs`. A plugin command which is not about the acquisition of one
platform, such as one which configures the plugin or synchronizes the
indicators it uses, belongs there too, in the `mvt.cli_plugins` group:
The `mvt` command hosts what belongs to neither platform: `version`,
`completion` and `download-iocs`. A plugin command which is not about the
acquisition of one platform, such as one which configures the plugin or
synchronizes the indicators it uses, belongs there too, in the
`mvt.cli_plugins` group:
```toml
[project.entry-points."mvt.cli_plugins"]