Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for argument placeholders #45

Open
xt0rted opened this issue May 1, 2022 · 1 comment
Open

Support for argument placeholders #45

xt0rted opened this issue May 1, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@xt0rted
Copy link
Owner

xt0rted commented May 1, 2022

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 xt0rted added the enhancement New feature or request label May 1, 2022
@AnderssonPeter
Copy link

This would be awesome if added!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants