Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Enabling implicit appbase (dnx . run -> dnx run) on Mono #2269

Merged
merged 2 commits into from Jul 22, 2015

Conversation

moozzyk
Copy link
Contributor

@moozzyk moozzyk commented Jul 16, 2015

The user no longer has to provide folder (or .) when running dnx commands.

Note that there might be an ambiguity between a folder and command which is resolved by checking if a folder with the provided name physically exists and if it does the parameter is treated as folder path otherwise it is treated as a command.

Fixes #1403

@moozzyk
Copy link
Contributor Author

moozzyk commented Jul 16, 2015

Same caveat as in #2263 - for backwards compatibility it allows specifying path to a folder (or '.').

var appbaseIndex = arguments.ToList().FindIndex(arg =>
string.Equals(arg, "--appbase", StringComparison.OrdinalIgnoreCase));
if (appbaseIndex >= 0 && (appbaseIndex < arguments.Length - 1))
int parameter_idx = FindAppBaseOrNonHostOption(arguments);
Copy link
Member

Choose a reason for hiding this comment

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

c++? Since when do we use _

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LOL - will fix.

@moozzyk moozzyk force-pushed the pawelka/appbase_mono branch 2 times, most recently from 9eca0d1 to 398e6bc Compare July 16, 2015 16:01
@moozzyk
Copy link
Contributor Author

moozzyk commented Jul 16, 2015

Removed checking if directory exists - now we only support ..

var appbaseIndex = arguments.ToList().FindIndex(arg =>
string.Equals(arg, "--appbase", StringComparison.OrdinalIgnoreCase));
if (appbaseIndex >= 0 && (appbaseIndex < arguments.Length - 1))
int parameterIdx = FindAppBaseOrNonHostOption(arguments);
Copy link
Contributor

Choose a reason for hiding this comment

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

var instead of int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - fixed.

@moozzyk moozzyk force-pushed the pawelka/appbase_mono branch 2 times, most recently from 70e6b6b to ff4d263 Compare July 16, 2015 22:39
@moozzyk
Copy link
Contributor Author

moozzyk commented Jul 17, 2015

{
for (var i = 0; i < arguments.Length; i++)
{
if (string.Equals(arguments[i], "--appbase", StringComparison.OrdinalIgnoreCase))
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am keeping the behavior we had before: https://github.com/aspnet/dnx/pull/2269/files#diff-71b95628dab21cdd062a2d2518c8ac05L81

@davidfowl should the option names be case sensitive? (dnx.exe does the same case insensitive check)

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep the current behavior for now.

moozzyk added 2 commits July 22, 2015 07:07
Before providing appbase folder was necessary. Now we don't expect a folder anymore but assume that the current folder is the appbase folder. The only exception is where for backwards compatibility we continue to recognize `.` (so `dnx . run` continues to work). If the user really wants to provide a folder that is not the current folder they need to use the --appbase parameter.

Fixes #1403
The user no longer has to provide folder (or `.`) when running dnx commands.

Note that there might be an ambiguity between a folder and command which is resolved by checking if a folder with the provided name physically exists and if it does the parameter is treated as folder path otherwise it is treated as a command.

Fixes #1403
@moozzyk moozzyk merged commit d901b0a into dev Jul 22, 2015
@moozzyk moozzyk deleted the pawelka/appbase_mono branch July 22, 2015 16:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dnx requiring "run" can be improved a bit
5 participants