How to define a repeatable param?

42 wyświetlenia
Przejdź do pierwszej nieodczytanej wiadomości

xy l

nieprzeczytany,
20 maj 2020, 22:53:2420.05.2020
do 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

nieprzeczytany,
21 maj 2020, 23:58:5321.05.2020
do 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

nieprzeczytany,
22 maj 2020, 01:21:0422.05.2020
do 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.
Odpowiedz wszystkim
Odpowiedz autorowi
Przekaż
Nowe wiadomości: 0