Menu

Issue with a particular syntax

Help
Cal
2008-07-07
2013-04-23
  • Cal

    Cal - 2008-07-07

    Hello,

    In order to use all the power of Natural CLI, I've tried to use the following command syntax :

         command [a] [b] [c]

    which express exactly my needs (the user can choose any combinations of these optionals parameters).

    Unfortunately it did not work.

    I had a good parseResult with the command "command c" ; but I got a "No command matches" with "command a".
    It worked also with "command a b c".
    "command" wasn't interpreted as a command neither.

    I don't think I made a mistake on my side (I put only letters inside brackets), however I would appreciate if you could tell me that it works on your side or if this syntax isn't supposed to be used.

    Thanks.

     
    • Cal

      Cal - 2008-07-07

      I said "any combinations of these optionals parameters" but I should have say "any combinations of these optionals tokens"

       
    • Ferran Busquets

      Ferran Busquets - 2008-07-08

      Hi Ca

      I'm going to see what is happening. I hope I give you an answer shortly.

      Regards,

      Ferran

       
    • Ferran Busquets

      Ferran Busquets - 2008-07-08

      Hi again Cal,

      It seems that there are a bug when optional parameter is the last token and it is not present.

      In your example will work any combination but if "c" is not present. It means:

        command a b c => works
        command   b c => works
        command a   c => works
        command     c => works
        command a b   => hits the bug and fails
        command   b   => hits the bug and fails
        command a     => hits the bug and fails
        command a     => hits the bug and fails

      As an **ugly** workaround, you can add a "fake" last token, for instance:

        command [a] [b] [c] fake

      Of course, I'm going to check the code to solve this issue.

      Thanks a lot for reporting!

      Ferran

       
    • Cal

      Cal - 2008-07-09

      Thank you for you answer !

      I'm looking forward to getting your bug fix :)

       
    • Ferran Busquets

      Ferran Busquets - 2008-07-19

      Hi Cal,

      The bug in fixed in the new release. You can download it here:

      https://sourceforge.net/project/showfiles.php?group_id=208949

      Thanks for reporting!

      Ferran

       
    • Cal

      Cal - 2008-07-22

      Great :)

      Thank you

       

Log in to post a comment.

MongoDB Logo MongoDB