robocode-dev / tank-royale

Git repository for Robocode Tank Royale
Apache License 2.0
144 stars 29 forks source link

Fix documentation of case-sensitive server arguments #68

Closed rhys-saldanha closed 1 year ago

rhys-saldanha commented 1 year ago

The more involved approach would've been to figure out how to configure pico-cli to be case insensitive, if that's a preferred approach? At least for now, the documentation matches the current behaviour.

flemming-n-larsen commented 1 year ago

It seems that there is an option for this in picocli: command.setCaseInsensitiveEnumValuesAllowed(true);

So I will try this out soon, and make a fix before making the release (0.19.3) this weekend.

rhys-saldanha commented 1 year ago

I think the configuration needed is:

https://picocli.info/apidocs/picocli/CommandLine.html#setOptionsCaseInsensitive-boolean- https://picocli.info/apidocs/picocli/CommandLine.html#setSubcommandsCaseInsensitive-boolean-

flemming-n-larsen commented 1 year ago

I think the configuration needed is:

https://picocli.info/apidocs/picocli/CommandLine.html#setOptionsCaseInsensitive-boolean- https://picocli.info/apidocs/picocli/CommandLine.html#setSubcommandsCaseInsensitive-boolean-

That is correct, and also the way I solved it for both the Server and Booter: 🙂 https://github.com/robocode-dev/tank-royale/blob/master/server/src/main/kotlin/Server.kt https://github.com/robocode-dev/tank-royale/blob/master/booter/src/main/kotlin/dev/robocode/tankroyale/booter/Booter.kt

I made a new release on Friday with these fixes, and I did change the botSecrets and controllerSecrets into bot-secrets and controller-secrets to be consistent with the other command-line commands and options.