Skip to content

Should the CLI support user default setting values #9344

@spboyer

Description

@spboyer

Working with a Razor Pages app. Having to type the namespace value over and over when adding a new page to the application.

> dotnet new page --name Index -na MyAppName.Pages.Area -o Pages/Area

> dotnet new page --name NextPage -na MyAppName.Pages.Area -o Pages/Area

Solved with creating local variable

> ns=-ns=MyAppName.Pages

> dotnet new page --name Index  $ns.Area -o Pages/Area

The Azure CLI offers user defaults once set the user does not have to specify them in the actual command at all.

az configure --defaults location="East US" group="mysuperappgroup" 

[defaults]
location = East US  
group = mysuperappgroup 

# create a web application usually needing the above location and group specified.
az appservice web create -n myapp

It would suffice that the dotnet application should support this feature for things like --framework, --language, --nuget-source etc. without having to have the developer script specifically via bash, powershell or some other means.

Metadata

Metadata

Assignees

Labels

Area-CLIconfig-system-candidateIssues that could be solved cleanly if the .NET CLI had a git-like configuration system

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions