Menu

Parsing parameters with more than one word

Help
Anonymous
2012-11-08
2013-04-23
  • Anonymous

    Anonymous - 2012-11-08

    Hi.

    I think this is not possible with the current version but I will post here just in case and it can also serve as a possible improvement for the parsing if others find it useful.

    I need to support a command that has two parameters that can have multi-words values.
    Something like this:
            set name <n_value:multi-word-string> alias  <a_value:multi-word-string>
    One possible use of it would be:
            set name “Roger Moore” alias “James Bond”

    Unfortunately (for me) Natural CLI string parameter only accepts one word and not even surrounding the multi word parameter with “ does the trick.

    The obvious solution is to break the command in two different commands: one to set the name and other to set the alias. Something like this:
          set name …
          set alias …

    Is there any way to implement it only with one command?

    Thanks,
        Ricardo

     
  • Anonymous

    Anonymous - 2012-11-08

    Just to say that I forgot an element in the syntax for the two commands solution. It should be like this:
               set name <name:string> …
               set alias <alias:string> …
    In this cases we should write our own help function to mask the workaround we have in the syntax.

     

Log in to post a comment.

MongoDB Logo MongoDB