Enabling implicit appbase (dnx . run
-> dnx run
) on Mono
#2269
Conversation
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); |
There was a problem hiding this comment.
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 _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL - will fix.
9eca0d1
to
398e6bc
Compare
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var
instead of int
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - fixed.
70e6b6b
to
ff4d263
Compare
⌚ |
{ | ||
for (var i = 0; i < arguments.Length; i++) | ||
{ | ||
if (string.Equals(arguments[i], "--appbase", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that in CommandUtil
the options names are compared in case sensitive way.
https://github.com/aspnet/dnx/blob/dev/src/Microsoft.Framework.CommandLineUtils.Sources/CommandLine/CommandLineApplication.cs#L125
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
ff4d263
to
24965ea
Compare
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
24965ea
to
d901b0a
Compare
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