dotnet-run-script icon indicating copy to clipboard operation
dotnet-run-script copied to clipboard

Support for argument placeholders

Open xt0rted opened this issue 3 years ago • 1 comments

This is similar to how npm-run-all supports this and will allow passing values to different parts of the script.

  • {1}, {2}, ... - An ordered argument quoted
  • {@} - All arguments individually quoted
  • {*} - All arguments joined with spaces and quoted as a single value

An example of this:

{
  "scripts": {
    "migration": "dotnet ef migrations add {1} --project \"./src/Acme.Data\" --startup-project \"./src/Acme.Web\""
  }
}

A placeholder technically isn't needed in this example since the name can be passed at the end but it's still a valid example.

> dotnet r migration -- "A cool new feature"

npm-run-all has support for default values using the syntax {1:-foo} where if no parameters are passed then foo is used in that spot. You can also specify a "global" default using the syntax {1:=foo} where that instance and every subsequent instance of {1} will also be foo. Both of these features are out of scope for the initial implementation.

xt0rted avatar May 01 '22 06:05 xt0rted