Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show help when no args are passed #596

Merged
merged 5 commits into from Aug 24, 2017
Merged

Show help when no args are passed #596

merged 5 commits into from Aug 24, 2017

Conversation

prafullbhosale
Copy link
Contributor

@prafullbhosale prafullbhosale changed the title Pb/rel/2.0.1 Show help when no args are passed Aug 16, 2017
<value>Scaffolding failed.</value>
</data>
<data name="NoCodeGeneratorsFound" xml:space="preserve">
<value>No codegenerators are available in this project. Please add 'Microsoft.VisualStudio.Web.CodeGeneration.Design' NuGet package to the project.</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: "code generators" maybe?

Copy link
Member

Choose a reason for hiding this comment

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

Also: Please add **the** 'foobar' ...

@Eilon
Copy link
Member

Eilon commented Aug 17, 2017

This seems like a pretty large change (200+ lines) for something that on the surface sounds quite straightforward. Is there no simpler way to handle this case?

@prafullbhosale
Copy link
Contributor Author

The large part of the change is wrapping the entry points in a try-catch block (which has caused indentation changes).

@Eilon
Copy link
Member

Eilon commented Aug 17, 2017

Is there no way to just detect that there are no args and show the help info?

@Eilon
Copy link
Member

Eilon commented Aug 17, 2017

Also, even without the white space changes, it's still 150 lines...

@prafullbhosale
Copy link
Contributor Author

There is a way to just detect that with smaller number of changes.
However, that doesn't handle the case when the command line looks something like this:

dotnet aspnet-codegenerator -p pathToProject

This currently causes dotnet.exe to crash as exceptions are thrown and not handled gracefully.

So yes, this PR does more than advertised earlier:

  1. Show help when no args are passed.
  2. Handle exceptions gracefully without crashing dotnet.exe

@Eilon
Copy link
Member

Eilon commented Aug 17, 2017

I see, so this change is really about "do better handling of all cases of invalid/missing/whatever command line args"?

@prafullbhosale
Copy link
Contributor Author

yes, that is correct.

@Eilon
Copy link
Member

Eilon commented Aug 18, 2017

Ok, it's up to you and @mlorbetske to figure out the best change. In general for patches we try to address just the affected issue or else we risk regressions, so do whatever you feel is best.

@prafullbhosale
Copy link
Contributor Author

Discussed this with @mlorbetske. We decided to take this as its a relatively safe change and provides a better user experience by not letting dotnet.exe crash with exceptions due to invalid/ missing command line arguments.

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.

None yet

5 participants