How to define a repeatable param?

42 views
Skip to first unread message

xy l

unread,
May 20, 2020, 10:53:24 PM5/20/20
to klish
Hello,
For example, my COMMAND is like this.
 
<COMMAND name="hostname">
   
<PARAM name="name" ptype="STRING"/>
</COMMAND>
 
Then how to make name repeatable? And how to get the right value sequence?
 
{prompt}# hostname name1 name2 ... <cr>

Thank you 
 

Klemen Sladic

unread,
May 21, 2020, 11:58:53 PM5/21/20
to kl...@googlegroups.com
Hi.

Not exactly what you want, but if number of arguments (names) is limited to few you may use something like this:

<COMMAND name="hostname"
   help="Set hostname(s)."
   <PARAM name="name1"
      help="Hostname1"
      ptype="STRING"/>
   <PARAM name="name2"
      optional="true"
      help="Hostname2"
      ptype="STRING"/>
   <PARAM name="name3"
      optional="true"
      help="Hostname3"
      ptype="STRING"/>

   <ACTION>TODO: set hostname(s).</ACTION>
   </COMMAND>

RegK


--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish/e24a232c-d814-4379-806d-24bec3987758%40googlegroups.com.

xy l

unread,
May 22, 2020, 1:21:04 AM5/22/20
to klish
Yeah, maybe it is a workaround.

Take an example, I want to add several domain names, their format are the same, like this.

# domain google.com
# domain google.com amazon.com
# domain google.com amazon.com yahoo.com
 
So I think "one" repleatable PARAM is enough. But I don't know how to.

在 2020年5月22日星期五 UTC+8上午11:58:53,Klemen Sladic写道:
To unsubscribe from this group and stop receiving emails from it, send an email to kl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages