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

CLI - allow second parameter to specify name of project/item template #3009

Open
Tracked by #4887
jamesmontemagno opened this issue Apr 9, 2021 · 6 comments
Open
Tracked by #4887
Assignees
Labels
area: CLI Related to dotnet new CLI (usually dotnet/TemplateEngine.CLI source code) feature The issue defines new feature. good first issue easy issue, good for first-time contribution to the repo Priority:1 Work that is critical for the release, but we could probably ship without triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Milestone

Comments

@jamesmontemagno
Copy link
Member

Today you have to pass in the -n argument for the name of the project or template. For Example

dotnet new page -n MyPage -na MyNamespace

You almost always are going to specify -n for item templates, ideally you could just pass in a second parameter which is the next default, in this case -n.

This would pair great with #3008, which would allow for

dotnet new class MyClass
@bekir-ozturk bekir-ozturk added feature The issue defines new feature. need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases triaged The issue was evaluated by the triage team, placed on correct area, next action defined. labels Apr 12, 2021
@KathleenDollard
Copy link

For context, this is something that came up when James and I were chatting about templates and I asked him to file this issue. I'd like it in the backlog for after we have the new parser and as we are considering how to incorporate more item templates in the CLI (so that we are consistent across item templates)

@vlada-shubina vlada-shubina added templates and removed triaged The issue was evaluated by the triage team, placed on correct area, next action defined. labels Apr 13, 2021
@KathleenDollard KathleenDollard removed the need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases label Apr 13, 2021
@bekir-ozturk bekir-ozturk added this to the Backlog milestone Apr 19, 2021
@bekir-ozturk bekir-ozturk added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Apr 26, 2021
@vlada-shubina vlada-shubina mentioned this issue Jun 23, 2022
26 tasks
@egvijayanand
Copy link
Contributor

egvijayanand commented Mar 6, 2023

This is in the backlog for almost 2 years, can this be included in the scope for .NET 8 at least?

@baronfel
Copy link
Member

baronfel commented Mar 23, 2023

This is a candidate for .NET 8 based on team availability. The plan is as follows:

  • add a new optional positional argument for the name
    • will likely need a new custom argument parser to reject any tokens that start with -, as these are options that should be forwarded to the unique per-template option parsing
  • hide the existing -n option from help output to prevent confusion, but keep accepting it for compatibility purposes
  • raise a CLI syntax error if both the new positional argument and the existing argument are provided
  • work with docs to update syntaxes
  • CHECK TAB COMPLETION behavior (expected: all options are presented)

@baronfel baronfel modified the milestones: Backlog, 8.0P4 Mar 23, 2023
@YuliiaKovalova YuliiaKovalova added Priority:1 Work that is critical for the release, but we could probably ship without good first issue easy issue, good for first-time contribution to the repo area: CLI Related to dotnet new CLI (usually dotnet/TemplateEngine.CLI source code) and removed Iteration:2023April Iteration:2023May labels May 15, 2023
@YuliiaKovalova YuliiaKovalova modified the milestones: 8.0P4, Backlog May 18, 2023
@MiYanni MiYanni self-assigned this Jun 21, 2023
@egvijayanand
Copy link
Contributor

This has been in the backlog for quite a long time, can this be included in the scope for .NET 9 at least?

@MiYanni
Copy link
Member

MiYanni commented Dec 22, 2023

@egvijayanand

This has been in the backlog for quite a long time, can this be included in the scope for .NET 9 at least?

I had made a draft PR for the changes, but I'm not confident in them as the situation with CLI parsing for new is quite tricky in the current design. Hopefully, I'll be able to revisit those changes early in the new year.

@egvijayanand
Copy link
Contributor

I had made a draft PR for the changes, but I'm not confident in them as the situation with CLI parsing for new is quite tricky in the current design. Hopefully, I'll be able to revisit those changes early in the new year.

That's great to hear. Hope it makes it to the cut of .NET 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CLI Related to dotnet new CLI (usually dotnet/TemplateEngine.CLI source code) feature The issue defines new feature. good first issue easy issue, good for first-time contribution to the repo Priority:1 Work that is critical for the release, but we could probably ship without triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

No branches or pull requests

8 participants