Skip to content

dotnet-new update for RC4 - #1511

Merged
spboyer merged 12 commits into
masterfrom
dotnet-new
Feb 15, 2017
Merged

spboyer merged 12 commits into
masterfrom
dotnet-new

Conversation

@spboyer

@spboyer spboyer commented Feb 6, 2017

Copy link
Copy Markdown
Contributor

Title

Fixes #1450

Summary

Updates dotnet-new for RC4

Suggested Reviewers

@mairaw @BlackDwarf

@spboyer

spboyer commented Feb 6, 2017

Copy link
Copy Markdown
Contributor Author

Casing commit to address fix from dotnet/cli#5560

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @spboyer! I left you a few comments.

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated

## Synopsis
`dotnet new [--help] [--type] [--lang]`
`dotnet new [arguments] [options]`

@mairaw mairaw Feb 8, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should show the different synopses for each template as we discussed for dotnet sln, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we decided to make a new issue to create the git style consistent across all commands.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can change this to

dotnet new [template] [--language] [--list] [--name] [--output] [--show-all] [--help] 

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated
`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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we change this description to account for the fact that now dotnet new does more than to just initializing a project?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, Command-line here needs to be hyphened

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated
After this, the project is ready to be compiled and/or edited further.

## Arguments
template - The template to instansiate when the command is ivoked.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: ivoked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

**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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline code the framework values?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

netcoreapp1.0 and 1.1 are the only accepted values

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe list all the templates available in the description?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

help is shown twice in this list

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated
Create a F# console application project in the current directory:

`dotnet new` or `dotnet new --lang c#`
`dotnet new console --lang f#`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one dash from the lang parameter

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Prints out help for the command.

## Template options
Each project template may have additional options available. The core templates, for example, have the following.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a common convention on CLI commands, even outside of dotnet

dotnet new mvc --help

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional templates installed from NuGet or a custom location using dotnet new --install may have many other options available.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was referring to options, sorry. I've opened an issue for that: dotnet/templating#323

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated

## Synopsis
`dotnet new [--help] [--type] [--lang]`
`dotnet new [arguments] [options]`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@spboyer

spboyer commented Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

@mairaw @BlackDwarf - is this format good? I am going to do dotnet add remove list with this format.

@thesmithee

Copy link
Copy Markdown

@spboyer works for me.

@mairaw

mairaw commented Feb 14, 2017

Copy link
Copy Markdown
Contributor

which format are you referring to @spboyer?

@spboyer

spboyer commented Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

@mairaw the current "git" type format here.

@mairaw

mairaw commented Feb 14, 2017

Copy link
Copy Markdown
Contributor

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.

@spboyer

spboyer commented Feb 15, 2017

Copy link
Copy Markdown
Contributor Author

updated for git style and changes the warning to the INCLUDE.

@mairaw

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated
> [!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)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted


## Synopsis
`dotnet new [--help] [--type] [--lang]`
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I was expecting to see is each template with their respective options like framework, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated
## Synopsis
`dotnet new [--help] [--type] [--lang]`
```
dotnet new [template] [-lang|--language] [-n|--name] [-o|--output]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing --help here for the template line too

Comment thread docs/core/preview3/tools/dotnet-new.md Outdated

**classlib**

`-f|--framework` - Specifies which framework to target. Values: netcoreapp1.0 - 1.6 (Default: netcoreapp1.4).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it accepts netcoreapp1.0 or netcoreapp1.1 and netstandard1.0 - 1.6 and default is netstandard1.4

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, corrected

@thesmithee thesmithee left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it is good, but some changes as in comments would be good.


`-lang|--language`

Specifies the language of the template to create

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these a third-level heading?

@mairaw mairaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this! Thanks @spboyer!


## Synopsis
`dotnet new [--help] [--type] [--lang]`
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was referring to options, sorry. I've opened an issue for that: dotnet/templating#323

@spboyer
spboyer merged commit 96fd8ea into master Feb 15, 2017
@mairaw
mairaw deleted the dotnet-new branch February 17, 2017 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants