@@ -65,6 +65,8 @@ For example, the remaining command-line arguments after the first argument (the
6565(except for the arguments recognized by ` dotnet run ` unless they are after the ` -- ` separator)
6666and working directory is not changed (e.g., ` cd /x/ && dotnet run /y/file.cs ` runs the program in directory ` /x/ ` ).
6767
68+ ` dotnet path.cs ` is a shortcut for ` dotnet run path.cs ` provided that ` path.cs ` is a valid [ target path] ( #target-path ) .
69+
6870### Other commands
6971
7072Commands ` dotnet restore file.cs ` and ` dotnet build file.cs ` are needed for IDE support and hence work for file-based programs.
@@ -294,28 +296,24 @@ Also, `InternalsVisibleTo` needs to be added into a C# file as an attribute, or
294296
295297### Shebang support
296298
297- It might be beneficial to also ship ` dotnet-run ` binary
298- (or ` dotnet-run-file ` that would only work with file-based programs, not project-based ones, perhaps simply named ` cs ` )
299- because some shells do not support multiple command-line arguments in the shebang
299+ Some shells do not support multiple command-line arguments in the shebang
300300which is needed if one wants to use ` /usr/bin/env ` to find the ` dotnet ` executable
301- (although ` -S ` argument can be sometimes used to enable multiple argument support):
301+ (although ` -S ` argument can be sometimes used to enable multiple argument support),
302+ so ` dotnet file.cs ` instead of ` dotnet run file.cs ` should be used in shebangs:
302303
303304``` cs
304305#!/usr/bin/env dotnet run
305306// ^ Might not work in all shells. "dotnet run" might be passed as a single argument to "env".
306307```
307308``` cs
308- #!/usr/bin/env dotnet-run
309+ #!/usr/bin/env dotnet
309310// ^ Should work in all shells.
310311```
311312``` cs
312313#!/usr/bin/env -S dotnet run
313- // ^ Workaround in some shells.
314+ // ^ Works in some shells.
314315```
315316
316- We could also consider making ` dotnet file.cs ` work because ` dotnet file.dll ` also works today
317- but that would require changes to the native dotnet host.
318-
319317### Other possible commands
320318
321319We can consider supporting other commands like ` dotnet pack ` , ` dotnet watch ` ,
0 commit comments