-
Notifications
You must be signed in to change notification settings - Fork 178
Closed
Description
Today, running dotnet script eval
shows help. I suggest changing the default behaviour to read the code from standard input input. It would enable naturally evaluating a script in pipelines:
PS> echo 'Console.WriteLine(DateTime.Now)' | dotnet script eval
PS> 1..10 | % { "Console.WriteLine($_);" } | dotnet run -p .\src\Dotnet.Script -f netcoreapp3.1 -- eval
As well as:
curl http://example.com/script.csx | dotnet script eval
The above example would make support of running remote scripts obsolete.
Since the current default behaviour of showing help is not something someone would be relying on programmatically (e.g. via shell scripts), this change could be considered non-breaking.
An alternative would be that if the code argument given to dotnet script eval
is exactly a hypen (-
) then it would mean read code from standard input, but this seems less discoverable and somewhat of a superficial requirement.
Metadata
Metadata
Assignees
Labels
No labels