deniszykov/commandline

Error handling degraded in v. 1.2.2

Closed this issue · 4 comments

Hi Denis,
I have upgraded to the latest v.1.2.2 through NuGet system and the behaviour changed. Now just press enter (pass no parameters) it throws an exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: failedMethodBindings
   at System.MethodBindResult..ctor(String methodName, Dictionary`2 failedMethodBindings)
   at System.CommandLine.BindMethod(Type type, String defaultMethodName, CommandLineArguments arguments)
   at System.CommandLine.Run(Type type, CommandLineArguments arguments, String defaultCommandName)

Where as previously in v.1.1.2 it would provide a useful prompt showing how to use the console:

==========================================================
************ Sevice console, version:0.1 ************
==========================================================
>>
Unknown command '<no name specified>'.
Commands:
  MAIN
  SAYHELLO
  CONNECT
  QUIT
  START
  SET
  GET
  COMMIT
  MOVE
  SET_SPEED

Is this meant to be, or is it transitory issue you are trying to fix?

By the way, even in v. 1.1.2 it seems it is not as resilient as in previous version I had. I I just enter "move" without additional parameters (correct use of "move" requires additional parameters) it throws, previously it would show you the expected and optional parameters for the command... so the user could try again.

Hi @shellinspector! It was bugs after 'binding' refactoring. And I hope they all gone in v.1.2.4 that I just published.

Thanks, Denis, the 1.2.4 does work better. However, there is still a problem of not having the program give help in form of expected parameters for a command. If you type a command without needed parameters it just says "Error: command 'xxx' is not found" Somehow it all played better in a version from a year ago.

Hi @shellinspector! I have refactored and tuned description messages in v.1.2.5. You can check it and leave feedback if you want.