Skip to content

dotnet fsi command line: -- has no effect #18983

@Lamarth

Description

@Lamarth

It should be possible to pass a command line argument without trying to run it. I'm just now migrating from framework and I can't find any way to pass an argument to my script.

Repro steps

printfn "fsi.CommandLineArgs.Length = %d" fsi.CommandLineArgs.Length
fsi.CommandLineArgs |> Array.iteri (fun i arg -> printfn "  [%d] = %s" i arg)

dotnet fsi --use:test_args.fsx -- myarg

Expected behavior
(as seen with the Framework: fsi --use:test_args.fsx -- myarg)

fsi.CommandLineArgs.Length = 2
[0] = test_args.fsx
[1] = myarg

Actual behavior

fsi.CommandLineArgs.Length = 1
[0] = myarg

stdin(0,1): error FS0078: Unable to find the file 'myarg' in any of
C:<removed>

Known workarounds

None

Related information

  • Windows 11
  • .NET Core (Microsoft (R) F# Interactive version 13.9.303.0 for F# 9.0)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions