question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should the CLI support user default setting values

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, May 4, 2018

In .gitconfig we can define aliases like:

[alias]
    dnc = !dotnet new console -n $2
etc.

docs: https://git-scm.com/docs/git-config

with usage: git dnc myConsoleApp. This works across the platforms/shells (as git installer itself packs unix shell in Windows for cmd/powershell usage). .dotnetconfig or .netconfig with [alias] support would be a great match!

2reactions
livarcocccommented, May 4, 2018

@KathleenDollard @nguerrera another application for dotnet config

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring the CLI
The CLI supports using a file for CLI-specific configurations. You can: Specify a default profile. Set default values for command options so ...
Read more >
Environment variables to configure the AWS CLI
Environment variables provide another way to specify configuration options and credentials, and can be useful for scripting or temporarily setting a named ...
Read more >
Azure CLI configuration options
The Azure CLI allows for user configuration for settings such as logging, data collection, and default argument values. The CLI offers a ...
Read more >
Configuration and Control CLI Commands
Use the following CLI commands for configuration and control. ... The default is 8443. n must be a value in the range of...
Read more >
Cisco Identity Services Engine CLI Reference Guide ...
CLI configuration commands can have a default form, which returns the command settings to the default values. Most commands disable by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found