Skip to content

fsi incorrect handling of some script arguments #19214

@g874200

Description

@g874200

Consider script test_args.fsx:

printfn "%A" fsi.CommandLineArgs

When execing:

>dotnet fsi test_args.fsx -r -f
[|"test_args.fsx"; "-r:-f"|]

When using:

>dotnet fsi --use:test_args.fsx -- -- -r -f

Microsoft (R) F# Interactive version 14.0.101.0 for F# 10.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> [|"test_args.fsx"; "-r:-f"|]
val it: unit = ()

From looking over fsi.fs, it seems that PostProcessCompilerArgs is called before any other command line processing. This will find the '-r' and treat it as an abbreviated --reference option, combining it with its "argument" into a single -r:-f. Perhaps, rather than the initial PostProcessCompilerArgs, the check for a space-separated arg for -r (for example) could be added to the main loop in ParseCompilerOptions.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions