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

System.CommandLine is split into too many namespaces #1680

Open
jkotas opened this issue Mar 20, 2022 · 3 comments · Fixed by #1788
Open

System.CommandLine is split into too many namespaces #1680

jkotas opened this issue Mar 20, 2022 · 3 comments · Fixed by #1788
Labels
Area-API Breaking Change bug Something isn't working
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented Mar 20, 2022

I end up writing the following battery of namespaces into every project:

using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing;

Should these namespaces be all folded into one?

This design is in conflict with .NET Framework design guidelines:

AVOID having too many namespaces.

Users of a framework should not have to import many namespaces in the most common scenarios.
@jonsequitur jonsequitur added the bug Something isn't working label Mar 20, 2022
@jonsequitur jonsequitur added this to the 2.0 GA milestone Mar 20, 2022
@Marusyk
Copy link
Member

Marusyk commented Apr 16, 2022

Can I take this one and remove System.CommandLine.Builder, CommandLine.Invocation, CommandLine.Parsing?
what about backward compatibility?

@jonsequitur
Copy link
Contributor

I think some discussion is needed.

There was concern in our previous API review that the root namespace would be too cluttered for people to immediately find the most important "entry point" types in the library, which is why more namespaces were created. It would be good to simplify, though, and now before we remove the preview tag is the time to make breaking changes.

@jonsequitur
Copy link
Contributor

jonsequitur commented Jun 30, 2022

Here's a list of proposed changes, intended to move some of the most common types into the root System.CommandLine namespace while leaving other less commonly-used types in their more specific namespaces so as not to introduce clutter.

  • Remove the System.CommandLine.Builder namespace and move its two types to System.CommandLine.
  • Move System.CommandLine.Parsing.ParseResult to System.CommandLine.
  • Move System.CommandLine.Invocation.ICommandHandler to System.CommandLine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-API Breaking Change bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants