Skip to content

dotnet sln - #1519

Merged
mairaw merged 9 commits into
masterfrom
dotnet-sln
Feb 14, 2017
Merged

mairaw merged 9 commits into
masterfrom
dotnet-sln

Conversation

@spboyer

@spboyer spboyer commented Feb 6, 2017

Copy link
Copy Markdown
Contributor

dotnet-sln

Summary

new document for RC3/4 to address dotnet-sln

Fixes #1448

@mairaw @BlackDwarf


Prints out a short help for the command.

## Examples

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would be good to have an example of the invocation that assumes the sln file, e.g. dotnet sln add project.csproj or something similar.

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.

added


dotnet-sln -- Modify a .NET Core solution file.

## Synopsis

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Synopsis should be different. It should read something like dotnet sln [add] [remove] [list] <argument>.

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

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.

@BlackDwarf if we followed a similar pattern we have been using for other commands, this would probably look like this: dotnet sln [<solution_file_path>] [<add|remove|list>] [--help] [<projects>], no?


List all projects in a solution file.

## Arguments

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also, the project file. Another note should be that on unix shells (bash) you can use globs.

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.

So you can add multiple projects using globbing? or just a single path?

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 I managed to add projects by using one after the other in the command-line like
C:\temp\HelloWorld>dotnet sln add C:\temp\HW2\HW2.csproj c:\temp\hw3\hw3.csproj

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yep. You can do more than one.

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 are the other ways @BlackDwarf?

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 the only other way would be to provide a glob, and if the shell expands it (bash does) it will be the same as putting in multiple projects manually.

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

we have to see how we want to present the commands now that they're getting more complex. we used to list everything as options before (such as https://docs.microsoft.com/en-us/dotnet/articles/core/preview3/tools/dotnet-pack). But now each command, have extra commands.

Comment thread docs/core/preview3/tools/dotnet-sln.md Outdated
description: The dotnet-sln command provides a convenient option to add, remove, and list projects in a solution file.
keywords: dotnet-run, CLI, CLI command, .NET Core
author: spboyer
ms.author: spboyer

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 you want me to be responsible for this topic, you can put my alias as ms.author (mairaw)

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.

ok.

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

# dotnet-sln (Tooling RC4)

dotnet-sln -- Modify a .NET Core solution file.

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.

Modify -> Modifies


dotnet-sln -- Modify a .NET Core solution file.

## Synopsis

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.

@BlackDwarf if we followed a similar pattern we have been using for other commands, this would probably look like this: dotnet sln [<solution_file_path>] [<add|remove|list>] [--help] [<projects>], no?


List all projects in a solution file.

## Arguments

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 I managed to add projects by using one after the other in the command-line like
C:\temp\HelloWorld>dotnet sln add C:\temp\HW2\HW2.csproj c:\temp\hw3\hw3.csproj

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

`add`

Add a project to the solution file.

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.

Add -> Adds and similar fixes for the other commands

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

## Examples

Add a project to a solution.

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.

end in colon here

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

`dotnet sln todo.sln add todo-app/todo-app.csproj`

Add a project to a solution

@mairaw mairaw Feb 6, 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.

Add a project to the solution in the current directory, perhaps?

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

`dotnet sln add todo-app.csproj`

Remove a project from a solution.

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.

end in colon

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

## Arguments

Solution file to use. If not specified, the command will search the current directory for one.

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.

Might be worth noting that the not specified one only works if you have only solution in the directory. If there's more than one, you're forced to specify the solution file.

Comment thread docs/core/preview3/tools/dotnet-sln.md Outdated
`add <project> <project>`

Add a project to the solution file.
Adds a project or multiiple projects to the solution file.

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: multiiple

@mairaw

mairaw commented Feb 6, 2017

Copy link
Copy Markdown
Contributor

For the synopsis, should we do similar to the git commands that show the different syntaxes?
e.g. https://git-scm.com/docs/git-checkout

so we'd have one line showing dotnet sln add, another one dotnet sln list, etc.

@spboyer

spboyer commented Feb 6, 2017

Copy link
Copy Markdown
Contributor Author

@mairaw if we are going to do that, which I am ok with. It can get large with something like dotnet new where the permutations are large. If we do it, let's be consistent.

@thesmithee

Copy link
Copy Markdown

I would agree with @mairaw on this. But we need to be consistent across all commands.

@mairaw

mairaw commented Feb 7, 2017

Copy link
Copy Markdown
Contributor

@spboyer yeah I know the permutations can get large for some commands. I'm just trying to see the best way to represent all the different options on a clear way. I liked the way git resolved that. and yes, we'd need to be consistent @BlackDwarf. I can open an issue to review that later on. I don't think we ran into this before.

@spboyer

spboyer commented Feb 7, 2017

Copy link
Copy Markdown
Contributor Author

So what is the direction on this PR?

A. Make the change like git?
B. Leave as is and create a new issue to change all commands to match git?
C. Combination of A + B?

@mairaw

mairaw commented Feb 7, 2017

Copy link
Copy Markdown
Contributor

I'd go with option A for this PR. @BlackDwarf?

@thesmithee

Copy link
Copy Markdown

A and create an issue.

@mairaw

mairaw commented Feb 7, 2017

Copy link
Copy Markdown
Contributor

I'll create the issue.

@mairaw

mairaw commented Feb 10, 2017

Copy link
Copy Markdown
Contributor

can you make the changes to have the git style commands @spboyer as previously discussed?

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

Looks good now modulo one comment I made.


```bash
dotnet sln [<SLN_NAME>] add <project> <project>
dotnet sln [<SLN_NAME>] add **/**

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@spboyer I'm curious, did you test this on PowerShell/CMD and does it 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.

the dotnet add <project> <project> interesting find however.

In powershell

dir **\**\*.fsproj


    Directory: /Users/shayneboyer/projects/fsharp/FSNEtCore/src/App


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
------           2/7/17   1:51 PM            873 App.fsproj


    Directory: /Users/shayneboyer/projects/fsharp/FSNEtCore/src/Library


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
------           2/7/17   1:52 PM            848 Library.fsproj

returns the correct items, but

PS /Users/shayneboyer/projects/fsharp/FSNEtCore> dotnet sln add **\**\*.fsproj
Project `**\**\*.fsproj` does not exist.

Errors out when adding.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

My findings exactly. I'm split. Should we document it and somehow mention it is available only in bash, or ignore it and let bash users figure it out on their own?

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.

I like the way it is now, documented.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You know that people are going to try this in CMD and then file that it doesn't work, right? can we at least put in a caveat or something? Note?

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.

I have it in the commands section

Glob pattern is supported on Unix/Linux based terminals.

Can either remove it from the synopsis
or
add # Unix / Linux based systems to the end of it

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 add an example with the glob pattern (and the caveat) too?

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 there is one there in the examples.

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

A few questions/comments


## Arguments

Solution file to use. If not specified, the command will search the current directory for one. If there are multiple solution files in the directory; one must be specified.

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 say here that this relates to SLN_NAME? Otherwise, international customers might not know what SLN_NAME refers to when reading the localized version. Such as
SLN_NAME - Solution file to use...

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.

added.


`add **/*`

Adds a project or multiple projects to the solution file. Glob pattern is supported on Unix/Linux based terminals.

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.

add a hyphen before based?

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.

i'll remove "based" to read more clearly

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

## Synopsis

```bash

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're not using language identifiers for the synopsis block

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.

removed


```bash
dotnet sln [<SLN_NAME>] add <project> <project>
dotnet sln [<SLN_NAME>] add **/**

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 add an example with the glob pattern (and the caveat) too?

@mairaw

mairaw commented Feb 13, 2017

Copy link
Copy Markdown
Contributor

Also, the topic should be added to the TOC with the other RC4 tools.

Comment thread docs/core/preview3/tools/dotnet-sln.md Outdated
---
# Name

## dotnet-sln (Tooling RC4)

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.

This should be the H1 of the article (the Tooling RC4 can go away since it's the only version). And then the following line should be added after the H1 header:
[!INCLUDE[preview-warning](../../../includes/warning.md)]

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.

But it's only available in RC4. Shouldn't that be called out with that?

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.

updated to

# dotnet-sln

[!INCLUDE[preview-warning](../../../includes/warning.md)]

dotnet-sln -- Modifies a .NET Core solution file.

Comment thread docs/core/preview3/tools/dotnet-sln.md Outdated
ms.devlang: dotnet
ms.assetid: e5a72d3e-c14b-4b0a-a978-c5e54a0988c6
---
# Name

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.

This should be the first H2

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

Thank you @spboyer! I've added the missing header so we can merge this.

@mairaw
mairaw merged commit 6c0474e into master Feb 14, 2017
@mairaw
mairaw deleted the dotnet-sln branch February 14, 2017 22:31
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