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

single dash throws exception #252

Closed
davhdavh opened this issue Oct 7, 2015 · 6 comments
Closed

single dash throws exception #252

davhdavh opened this issue Oct 7, 2015 · 6 comments
Labels

Comments

@davhdavh
Copy link

davhdavh commented Oct 7, 2015

     CommandLine.Parser.Default.ParseArguments<object>(new []{"-"});

-> Exception

@gsscoder
Copy link
Owner

gsscoder commented Oct 7, 2015

This is for 2.0.*? I was about to discovering it with FsCheck but ordinary job distracted me thank you, @davhdavh.

For the moment I can't proceed, please read this temp announcement #250.

Have nice day! :)

@davhdavh
Copy link
Author

davhdavh commented Oct 7, 2015

Latest on nuget, so 2.0.257+.
Np on delay for fixing, a few weeks wont make any difference for me.

On Wed, Oct 7, 2015 at 1:22 PM, Giacomo Stelluti Scala <
notifications@github.com> wrote:

This is for 2.0.*? I was about to discovering it with FsCheck but ordinary
job distracted me thank you, @davhdavh https://github.com/davhdavh.

For the moment I can't proceed, please read this temp announcement #250
#250.

Have nice day! :)


Reply to this email directly or view it on GitHub
#252 (comment)
.

Dennis

@nemec
Copy link
Collaborator

nemec commented Oct 9, 2015

@davhdavh for reference, is this the error message you see?

System.IndexOutOfRangeException : Index was outside the bounds of the array.
StackTrace: 
    at System.String.get_Chars(Int32 index)
       at CommandLine.Core.Tokenizer.<TokenizeShortName>d__3e.MoveNext() in c:\commandline\src\CommandLine\Core\Tokenizer.cs:line 141
       at System.Linq.Enumerable.<SelectManyIterator>d__4`3.MoveNext()
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
       at CSharpx.EnumerableExtensions.Memorize[T](IEnumerable`1 source) in c:\commandline\paket-files\gsscoder\CSharpx\src\CSharpx\EnumerableExtensions.cs:line 377
       at CommandLine.Core.Tokenizer.Tokenize(IEnumerable`1 arguments, Func`2 nameLookup, Func`2 normalize) in c:\commandline\src\CommandLine\Core\Tokenizer.cs:line 29
       at CommandLine.Core.Tokenizer.<>c__DisplayClass39.<ConfigureTokenizer>b__31(IEnumerable`1 arguments, IEnumerable`1 optionSpecs) in c:\commandline\src\CommandLine\Core\Tokenizer.cs:line 122
       at CommandLine.Parser.Tokenize(IEnumerable`1 arguments, IEnumerable`1 optionSpecs, ParserSettings settings) in c:\commandline\src\CommandLine\Parser.cs:line 177
       at CommandLine.Parser.<ParseArguments>b__1[T](IEnumerable`1 arguments, IEnumerable`1 optionSpecs) in c:\commandline\src\CommandLine\Parser.cs:line 97
       at CommandLine.Core.InstanceBuilder.<>c__DisplayClass1e`1.<Build>b__8() in c:\commandline\src\CommandLine\Core\InstanceBuilder.cs:line 45
       at CommandLine.Core.InstanceBuilder.Build[T](Maybe`1 factory, Func`3 tokenizer, IEnumerable`1 arguments, StringComparer nameComparer, CultureInfo parsingCulture, IEnumerable`1 nonFatalErrors) in c:\commandline\src\CommandLine\Core\InstanceBuilder.cs:line 130
       at CommandLine.Parser.ParseArguments[T](IEnumerable`1 args) in c:\commandline\src\CommandLine\Parser.cs:line 94
       at CommandLine.Tests.Unit.ParserTests.Parse_options_with_single_dash() in c:\commandline\tests\CommandLine.Tests\Unit\ParserTests.cs:line 164

@nemec nemec closed this as completed in 5452c33 Oct 9, 2015
@nemec nemec reopened this Oct 9, 2015
@nemec
Copy link
Collaborator

nemec commented Oct 9, 2015

I think I fixed your issue (see tests in referenced commit), but I'll let you confirm before officially closing this issue. Thanks for reporting it!

@davhdavh
Copy link
Author

davhdavh commented Oct 9, 2015

Yes
On Oct 9, 2015 12:02 PM, "Dan Nemec" notifications@github.com wrote:

@davhdavh https://github.com/davhdavh for reference, is this the error
message you see?

System.IndexOutOfRangeException : Index was outside the bounds of the array.
StackTrace:
at System.String.get_Chars(Int32 index)
at CommandLine.Core.Tokenizer.d__3e.MoveNext() in c:\commandline\src\CommandLine\Core\Tokenizer.cs:line 141
at System.Linq.Enumerable.d__43.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at CSharpx.EnumerableExtensions.Memorize[T](IEnumerable1 source) in c:\commandline\paket-files\gsscoder\CSharpx\src\CSharpx\EnumerableExtensions.cs:line 377 at CommandLine.Core.Tokenizer.Tokenize(IEnumerable1 arguments, Func2 nameLookup, Func2 normalize) in c:\commandline\src\CommandLine\Core\Tokenizer.cs:line 29
at CommandLine.Core.Tokenizer.<>c__DisplayClass39.b__31(IEnumerable1 arguments, IEnumerable1 optionSpecs) in c:\commandline\src\CommandLine\Core\Tokenizer.cs:line 122
at CommandLine.Parser.Tokenize(IEnumerable1 arguments, IEnumerable1 optionSpecs, ParserSettings settings) in c:\commandline\src\CommandLine\Parser.cs:line 177
at CommandLine.Parser.b__1[T](IEnumerable1 arguments, IEnumerable1 optionSpecs) in c:\commandline\src\CommandLine\Parser.cs:line 97
at CommandLine.Core.InstanceBuilder.<>c__DisplayClass1e1.<Build>b__8() in c:\commandline\src\CommandLine\Core\InstanceBuilder.cs:line 45 at CommandLine.Core.InstanceBuilder.Build[T](Maybe1 factory, Func3 tokenizer, IEnumerable1 arguments, StringComparer nameComparer, CultureInfo parsingCulture, IEnumerable1 nonFatalErrors) in c:\commandline\src\CommandLine\Core\InstanceBuilder.cs:line 130 at CommandLine.Parser.ParseArguments[T](IEnumerable1 args) in c:\commandline\src\CommandLine\Parser.cs:line 94
at CommandLine.Tests.Unit.ParserTests.Parse_options_with_single_dash() in c:\commandline\tests\CommandLine.Tests\Unit\ParserTests.cs:line 164


Reply to this email directly or view it on GitHub
#252 (comment)
.

@nemec nemec closed this as completed Oct 9, 2015
@gsscoder
Copy link
Owner

Thanks again, @nemec!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants