cmd: Move stdiscosrv and strelaysrv in as subcommands to Syncthing #8953
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.
This adds
syncthing discosrv
andsyncthing relaysrv
as subcommands to Syncthing. This has several advantages:The main disadvantage is that it means we're carrying around more code in the syncthing binary that might not be required for all users; the increase on my system (darwin-arm64) is from 24.0 MB to 25.3 MB so I think this is acceptable.
There is a slight change in the CLI handling for the commands: the Go flag parser accepts long arguments with single dash, while kong does not. I changed a few timeout values from integer to duration for consistency, since it's anyway a breaking change. Given that nobody is going to get hit by this by mistake (there are no auto upgrades from the old binaries, and they need to run a different command) I think this is fine, too.
To do: