-
Notifications
You must be signed in to change notification settings - Fork 1k
sbt --client ignores other flags or SBT_OPTS #6468
Description
steps
- install official sbt launcher from GitHub releases
- run
sbt --clientwith any other CLI flags
problem
Other CLI flags are ignored. Examples:
► ./sbt/bin/sbt --error --no-colors --client 'print version'
► SBT_OPTS='-Dsbt.log.noformat=true' ./sbt/bin/sbt --client 'print version'
► env SBT_OPTS='-Dsbt.color=false' ./sbt/bin/sbt --client 'print version'
All above commands print with colors ignoring any attempts to disable it, here is a screenshot:
You can also see that the --error (or -error) flag gets ignored, so I get the undesired logging.
I've tried passing arguments in different order and via SBT_OPTS, but it seems that the launcher just ignores anything when there is --client flag. Same happens with the sbtn native client.
expectation
In this concrete use case I would like to be able to print the version setting value without any logs or color codes.
In general, I think sbt should treat arguments in the client mode same way as in the batch mode:
notes
► ./sbt/bin/sbt -version
sbt version in this project: 1.5.0
sbt script version: 1.5.0
I know that the launcher script treats "client mode" specially, but I think this functionality is essential for using sbt in scripts and integrating with other CLI tools. Running sbt in batch mode several times is too slow.

