Repository navigation
dotnet-new update for RC4 - #1511
Conversation
|
Casing commit to address fix from dotnet/cli#5560 |
|
|
||
| ## Synopsis | ||
| `dotnet new [--help] [--type] [--lang]` | ||
| `dotnet new [arguments] [options]` |
There was a problem hiding this comment.
we should show the different synopses for each template as we discussed for dotnet sln, no?
There was a problem hiding this comment.
we decided to make a new issue to create the git style consistent across all commands.
There was a problem hiding this comment.
can change this to
dotnet new [template] [--language] [--list] [--name] [--output] [--show-all] [--help]
There was a problem hiding this comment.
I thought that #1523 would only ensure that all others are consistent but sln and new should use the git style now IMO. Most of other commands don't have this characteristic.
| `dotnet new [arguments] [options]` | ||
|
|
||
| ## Description | ||
| The `dotnet new` command provides a convenient way to initialize a valid .NET Core project and sample source code to try out the Command Line Interface (CLI) toolset. |
There was a problem hiding this comment.
should we change this description to account for the fact that now dotnet new does more than to just initializing a project?
There was a problem hiding this comment.
also, Command-line here needs to be hyphened
| After this, the project is ready to be compiled and/or edited further. | ||
|
|
||
| ## Arguments | ||
| template - The template to instansiate when the command is ivoked. |
| **console, xunit, mstest** | ||
|
|
||
| Language of the project. Defaults to `C#`. Other valid values are `csharp` and `cs`. | ||
| `-f|--framework` - Specifies which framework to target. Values: netcoreapp1.0 or netcoreapp1.1 (Default: netcoreapp1.0) |
There was a problem hiding this comment.
inline code the framework values?
There was a problem hiding this comment.
also the framework also accepts other values, no? such as netstandard1.6, for example. we need a good topic to link for more info. https://docs.microsoft.com/en-us/dotnet/articles/standard/frameworks should be it but it needs work.
There was a problem hiding this comment.
netcoreapp1.0 and 1.1 are the only accepted values
There was a problem hiding this comment.
@mlorbetske is this true? I would think that for classlib templates we allow netstandard1.0 to netstandard1.6 right? On RC4 bits, this is what I get when I do dotnet new classlib --help:
Options:
-f|--framework
netcoreapp1.0 - Target netcoreapp1.0
netcoreapp1.1 - Target netcoreapp1.1
netstandard1.0 - Target netstandard1.0
netstandard1.1 - Target netstandard1.1
netstandard1.2 - Target netstandard1.2
netstandard1.3 - Target netstandard1.3
netstandard1.4 - Target netstandard1.4
netstandard1.5 - Target netstandard1.5
netstandard1.6 - Target netstandard1.6
Default: netstandard1.4
There was a problem hiding this comment.
@BlackDwarf @mlorbetske That is true. Addresses my point in the document.
Template options
Each project template may have additional options available.
I did add the classlib -f info that was missing from the doc
| Prints out a short help for the command. | ||
| Prints out help for the command. | ||
|
|
||
| ## Template options |
There was a problem hiding this comment.
if we're going to list the options for each template above (in the synopsis), then maybe we could have just one list with all options possible?
There was a problem hiding this comment.
Just following the template that we are using for the other commands.
| This command is invoked in the context of a directory. When invoked, the command will scaffold out the resources and files according to the template and options passed into the command. | ||
|
|
||
| After this, the project is ready to be compiled and/or edited further. | ||
|
|
There was a problem hiding this comment.
maybe list all the templates available in the description?
There was a problem hiding this comment.
the new templates that are available come from the templating system and are subject to change. I'd rather put in the command to see the templates for a specific type.
i.e. dotnet mvc -list
There was a problem hiding this comment.
I know they are subject to change but we do list them with the help command too and we already list them sparsely in the bottom without their default languages, etc.
| `-h|--help` | ||
|
|
||
| Prints out a short help for the command. | ||
| Prints out help for the command. |
There was a problem hiding this comment.
help is shown twice in this list
| Create a F# console application project in the current directory: | ||
|
|
||
| `dotnet new` or `dotnet new --lang c#` | ||
| `dotnet new console --lang f#` |
There was a problem hiding this comment.
remove one dash from the lang parameter
| Prints out help for the command. | ||
|
|
||
| ## Template options | ||
| Each project template may have additional options available. The core templates, for example, have the following. |
There was a problem hiding this comment.
I don't see the options available for each template with the help command. Is that a product bug @BlackDwarf? If so, I can file an issue in the https://github.com/dotnet/templating repo
There was a problem hiding this comment.
its a common convention on CLI commands, even outside of dotnet
dotnet new mvc --help
There was a problem hiding this comment.
@spboyer are you saying I should be seeing the extra arguments if I do dotnet new mvc --help? That's what I'm saying it's not working. At least with the version I have right now (1.0.0-rc4-004771)
There was a problem hiding this comment.
@mairaw you will see additional options. For example:
dotnet new classlib -h
You'll notice that -f|--framework is there as it is for the mvc template but accepts many more values.
Conversely, the mvc template:
dotnet new mvc -h
contains the following options:
Options:
-au|--auth The type of authentication to use
None - No authentication
Individual - Individual authentication
Default: None
-uld|--use-local-db Whether or not to use LocalDB instead of SQLite
bool - Optional
Default: false
-f|--framework
netcoreapp1.0 - Target netcoreapp1.0
netcoreapp1.1 - Target netcoreapp1.1
Default: netcoreapp1.0
There was a problem hiding this comment.
Additional templates installed from NuGet or a custom location using dotnet new --install may have many other options available.
There was a problem hiding this comment.
@mairaw has hit one of the weirdness of dotnet new. If you are in a context of a project (in a directory that has a csproj file), the dotnet new <template> --help command will not work. Filed dotnet/templating#332 for that.
In the meantime, we should add some safeguard text for this case.
There was a problem hiding this comment.
Yes, I was referring to options, sorry. I've opened an issue for that: dotnet/templating#323
mairaw
left a comment
There was a problem hiding this comment.
I had some comments that I can address them later if you want. I think it's good to merge to have the new command published.
|
|
||
| ## Synopsis | ||
| `dotnet new [--help] [--type] [--lang]` | ||
| `dotnet new [arguments] [options]` |
There was a problem hiding this comment.
I thought that #1523 would only ensure that all others are consistent but sln and new should use the git style now IMO. Most of other commands don't have this characteristic.
| This command is invoked in the context of a directory. When invoked, the command will scaffold out the resources and files according to the template and options passed into the command. | ||
|
|
||
| After this, the project is ready to be compiled and/or edited further. | ||
|
|
There was a problem hiding this comment.
I know they are subject to change but we do list them with the help command too and we already list them sparsely in the bottom without their default languages, etc.
|
@mairaw @BlackDwarf - is this format good? I am going to do |
|
@spboyer works for me. |
|
which format are you referring to @spboyer? |
|
@mairaw the current "git" type format here. |
|
I saw the use of the "git" type on dotnet-sln which looked fine to me. I'm not seeing here though so that's why I am confused @spboyer. |
|
updated for git style and changes the warning to the INCLUDE. |
| > [!WARNING] | ||
| > This topic applies to .NET Core Tools RC4. For the .NET Core Tools Preview 2 version, | ||
| > see the [dotnet-new](../../tools/dotnet-new.md) topic. | ||
| [!INCLUDE[preview-warning](../../../includes/warning.md)] |
There was a problem hiding this comment.
We've been using the include for topics that didn't exist in Preview 2. Otherwise, we take the customer directly to the Preview 2 topic.
|
|
||
| ## Synopsis | ||
| `dotnet new [--help] [--type] [--lang]` | ||
| ``` |
There was a problem hiding this comment.
what I was expecting to see is each template with their respective options like framework, etc.
There was a problem hiding this comment.
the options are specific to the templates and not to dotnet new. There may be additional templates installed using dotnet new --install.
It is mentioned in the doc here
Template options
Each project template may have additional options available. The core templates, for >example, have the following.
There was a problem hiding this comment.
yes, I know they're specific to each template. Let's keep as-is for now and I'll discuss this with @BlackDwarf later on.
| ## Synopsis | ||
| `dotnet new [--help] [--type] [--lang]` | ||
| ``` | ||
| dotnet new [template] [-lang|--language] [-n|--name] [-o|--output] |
There was a problem hiding this comment.
missing --help here for the template line too
|
|
||
| **classlib** | ||
|
|
||
| `-f|--framework` - Specifies which framework to target. Values: netcoreapp1.0 - 1.6 (Default: netcoreapp1.4). |
There was a problem hiding this comment.
it accepts netcoreapp1.0 or netcoreapp1.1 and netstandard1.0 - 1.6 and default is netstandard1.4
thesmithee
left a comment
There was a problem hiding this comment.
In general it is good, but some changes as in comments would be good.
|
|
||
| `-lang|--language` | ||
|
|
||
| Specifies the language of the template to create |
There was a problem hiding this comment.
"Programming language" would be better so that we are crystal clear.
| Prints out help for the command. | ||
|
|
||
| ## Template options | ||
| Each project template may have additional options available. The core templates, for example, have the following. |
There was a problem hiding this comment.
@mairaw has hit one of the weirdness of dotnet new. If you are in a context of a project (in a directory that has a csproj file), the dotnet new <template> --help command will not work. Filed dotnet/templating#332 for that.
In the meantime, we should add some safeguard text for this case.
|
|
||
| `-f|--framework` - Specifies which framework to target. Values: netcoreapp1.0 or netcoreapp1.1 (Default: netcoreapp1.0) | ||
|
|
||
| **web, webapi** |
There was a problem hiding this comment.
Can we make these a third-level heading?
|
|
||
| ## Synopsis | ||
| `dotnet new [--help] [--type] [--lang]` | ||
| ``` |
There was a problem hiding this comment.
yes, I know they're specific to each template. Let's keep as-is for now and I'll discuss this with @BlackDwarf later on.
| Prints out help for the command. | ||
|
|
||
| ## Template options | ||
| Each project template may have additional options available. The core templates, for example, have the following. |
There was a problem hiding this comment.
Yes, I was referring to options, sorry. I've opened an issue for that: dotnet/templating#323
Title
Fixes #1450
Summary
Updates dotnet-new for RC4
Suggested Reviewers
@mairaw @BlackDwarf