kspconfigtool

Crates.iokspconfigtool
lib.rskspconfigtool
version0.1.0
sourcesrc
created_at2023-04-04 02:26:39.995958
updated_at2023-04-04 02:26:39.995958
descriptionKSP1 ConfigNode parser and block removal tool
homepagehttps://github.com/lamont-granquist/kspconfigtool
repositoryhttps://github.com/lamont-granquist/kspconfigtool
max_upload_size
id829721
size27,844
Lamont Granquist (lamont-granquist)

documentation

https://github.com/lamont-granquist/kspconfigtool

README

KSP Config Tool

This is a rust "script" for removing parts/modules/resources from KSP1 craft files.

Its primary purpose is to clean up invalid stuff from 'stock' crafts for use in RSS/RO/RP-1.

Usage

For example:

kspconfigtool remove module TweakScale Ships/VAB/*.craft
kspconfigtool remove remove module ModuleColliderHelper Ships/VAB/*.craft
kspconfigtool remove resource LiquidFuel Ships/VAB/*.craft
kspconfigtool remove resource Oxidizer Ships/VAB/*.craft
kspconfigtool remove part sensorAccelerometer Ships/VAB/*.craft

It can also be used to read and write a craft file and 'clean' it up:

kspconfigtool clean Ships/VAB/*.craft

Behavior

  • It creates sequentially numbered backups: .orig1, .orig2, etc.
  • It preserves dos/unix line endings based on whatever it finds in the original file.
  • It uses tabs instead of spaces (like KSP itself appears to).
  • If there is nothing to do it does nothing (no backup file, etc).

Futures

  • Maybe extend the parser to read all the broken config files that the KSP parser reads.
  • Maybe flags for --dry-run, converting tabs to spaces, and selecting dos-vs-unix.
  • Maybe add a proper rust serde serializer/deserializer.
  • Has zero tests, needs tests.

Out Of Scope

  • Rewriting ModuleManager in Rust (no thanks).
  • KSP2 (just use JSON).
Commit count: 10

cargo fmt