Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Should the CLI support user default setting values #9194
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
[alias] dnc = !dotnet new console -n $2 etc.
You can do aliases many ways. .gitconfig is a clever way to do it xplat. However having functionality core to the CLI would be more expected.
Aliases are a way for devs to personalize their experience for their machines and tools, add shortcuts etc on top of the experience the tools give us out of the box.