Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The
SpaceDockAdder
uses aModAnalyzer
component to auto-generate netkans for a mod given its identifier and download URL. I've occasionally had reason to use this myself, but it's cumbersome because I have to run a command prompt,cd
toNetKAN-Infra/netkan
, runpython
,import netkan
, etc., and the output is in Python object format unless I also run a bunch of YAML related commands.As I've gotten more at home in VSCode, I remembered that the NetKAN-Infra repo had some kind of dev container thing set up for easy development and usage of its commands. This would be a great way to access the mod analyzer.
Changes
All existing services and utilities now have
short_help
to fill out the main command's help output:All existing services and utilities now have a doc string for the
netkan <command> --help
output:A new
netkan analyze-mod
command runs the mod analyzer and prints its output in YAML format. Note that it will exclude some fields that are known to theSpaceDockAdder
based on other sources of info, such as$kref
andlicense
:To make this conveniently usable, the
--game-id
parameter now defaults toKSP
. In addition, two pieces of superfluous output are suppressed; the first is changed from INFO to DEBUG (so hidden by default), and the second no longer appears when you don't pass--ssh-key
, which many commands do not need: