dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.34k stars 375 forks source link

Changed Pipeline creation from constructors to factory methods #2407

Closed KathleenDollard closed 2 months ago

KathleenDollard commented 2 months ago

I think we want really good discoverability on available pipelines. Constructors are not great on this, and I think the ergonomics of factory methods is better. If you know you want a pipeline, you can see what ones are available.

There are several options:

However we declare it, should empty look like standard with null instead of the default subsystems to aid discoverability, or should we use properties?

Is it bad to allow the subsystems to change after construction. Interesting things could happen.

This PR has the first option, and I kept an extra commit to show where I made mistakes, and the fixes show that the property requires two lines.

Looking forward to opinions.