Skip to content

Command argument parsing behavior changed with Mill 0.11.7 #3004

@lefou

Description

@lefou

This is most likely caused by the mainargs version update from 0.5.4 to 0.6.1

I have the following command, that stopped working as before and expected:

 def smokeTest( @mainargs.arg(doc = "Start the App inside a Xephyr server") xephyr: mainargs.Flag = mainargs.Flag(), @mainargs.arg(doc = "Start the App insie a Xvfb server") xvfb: mainargs.Flag = mainargs.Flag(), @mainargs.arg(doc = "The display server port to use") xport: String = ":90", @mainargs.arg(doc = "Arguments for the app launcher (e.g. `-console -consoleLog -noExit`)") args: mainargs.Leftover[String], @mainargs.arg(doc = "Timeout in seconds to cancel the test as failed") timeout: Int = 40 ) = T.command { ... }

I typically start it as follows:

> mill my.app.smokeTest --xvfb --timeout 60 -consoleLog 

The consoleLog is supposed to be parsed into args parameter, since it is a mainargs.Leftover[String].

Since the version bump to Mill 0.11.7, it fails with the following error message:

> mill my.app.smokeTest --xvfb --timeout 60 -consoleLog ... Unknown argument: "-c" Expected Signature: smokeTest --timeout <int> Timeout in seconds to cancel the test as failed --xephyr Start the App inside a Xephyr server --xport <str> The display server port to use --xvfb Start the App insie a Xvfb server args <str>... Arguments for the app launcher (e.g. `-console -consoleLog -noExit`) 

I also tried to force the parser to stop reading options with --, but it didn't work.

> mill my.app.smokeTest --xvfb --timeout 60 -- -consoleLog ... Unknown argument: "-c" Expected Signature: smokeTest --timeout <int> Timeout in seconds to cancel the test as failed --xephyr Start the App inside a Xephyr server --xport <str> The display server port to use --xvfb Start the App insie a Xvfb server args <str>... Arguments for the app launcher (e.g. `-console -consoleLog -noExit`) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue represents an bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions