Skip to content

sbt new fails to parse arguments correctly on Windows #7507

@ptrdom

Description

@ptrdom

steps

Replicated on sbt 1.9.9, running Windows Terminal (PowerShell).

  1. Open command line on Windows
  2. Run sbt new foundweekends/giter8.g8 --name=example.g8 --giter8_version=0.16.2 --sbt_version=1.9.9

problem

Command does not run successfully, error is throw:

Error: Unknown option --name
Error: Unknown argument 'example.g8'
Error: Unknown option --giter8_version
Error: Unknown argument '0.16.2'
Error: Unknown option --sbt_version
Error: Unknown argument '1.9.8'
Try --help for more information.

Command does work on Linux, tested on WSL (Ubuntu).

expectation

sbt project should be created from the template successfully with arguments passed to the template.

notes

After experimenting with variations of command, one version I found to work was sbt new foundweekends/giter8.g8 "--name=example.g8 " "--giter8_version=0.16.2 " "--sbt_version=1.9.9 " - arguments must be enclosed in quotes and must be terminated by a space.
One strange variation was that enclosing all arguments in quotes - sbt new foundweekends/giter8.g8 "--name=example.g8 --giter8_version=0.16.2 --sbt_version=1.9.9" - created the sbt project, but with only the name argument set to example.g8 --giter8_version=0.16.2 --sbt_version=1.9.9, meaning that sbt project's directory would end up containing the remaining part of argument string.
This does not seem intentional, likely a bug in parser module.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions