Description
this is going to be tricky. I managed to implement some commands like mise settings --complete
that lists completions for settings which works similarly:
$ mise settings --complete
activate_aggressive:Pushes tools' bin-paths to the front of PATH instead of allowing modifications of PATH after activation to take precedence.
all_compile:do not use precompiled binaries for any tool
always_keep_download:should mise keep downloaded files after installation
always_keep_install:should mise keep install files after installation even if the installation fails
Settings are fairly simple though because they're well-defined and we have the SETTINGS_META hash that gives us all the settings with their descriptions. For config, we don't really have a formal definition of what the config looks like, and it's much more complex.
For example, you should get this (ignoring descriptions to keep it simple but the actual solution should have descriptions too):
$ mise cfg --complete
env
tools
settings
...
And in order to dive in further:
$ mise cfg --complete settings.
settings.activate_aggressive
settings.all_compile
...
But this should also work with things like tools.node.
and tasks.foo.
.
Now we do have the json schema, but we don't read that in mise anywhere and I don't think parsing that in a useful way would be very easy at all.
2 other ideas aside from json schema:
- make
mise cfg --complete
written completely manually with all the options manually defined - create a new file like settings.toml that's used to generate both the json schema and these completions
I like the last idea the best since it would make it easier to stay up-to-date with changes in json schema but I'm not sure how well it would come together.