Conditional Parameters not working in klish 2.2.5

46 views
Skip to first unread message

Amol Lad

unread,
Jul 26, 2023, 3:41:13 AM7/26/23
to klish
Hi,

I'm trying the reference ping.xml which comes in klish package. As you can see the parameters "resolve", "repeat" and "size" are visible even for "arp" proto. The XML definition has test='"${proto}"!="arp"' for these commands. Please advise if I'm doing something wrong? Do we need to enable any compiler switch to enable "test=" directive?

Thanks in advance

> ping arp 192.168.4.1 ?
  source            Source IP-address (ip) or interface (ip and arp)
  repeat            Requests to send count, default is 5
  resolve           Resolve names
  broadcast         Ping broadcast address
  size              Packet size
  interval          The time interval between packets, default is 1
  flood             Flood ping
  duplicate-detect  Duplicate address detection mode
  <cr>

...
         <PARAM name="size"
                        test='"${proto}"!="arp"'
                        help="Packet size"
                        optional="true"
                        mode="subcommand"
                        ptype="SUBCOMMAND">
                        <PARAM name="psize"
                                help="Number of data bytes to send"
                                ptype="UINT"/>
                </PARAM>
 ...
Thanks

serj.kalichev

unread,
Jul 26, 2023, 4:04:49 AM7/26/23
to kl...@googlegroups.com

hi

Try spaces around !=.


test='"${proto}" != "arp"'


26.07.2023 10:41, Amol Lad пишет:
--
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/de515fc8-1b8b-496d-b69c-03164f39abdfn%40googlegroups.com.

Amol Lad

unread,
Jul 26, 2023, 4:07:54 AM7/26/23
to kl...@googlegroups.com
Thanks !! It worked!!

You received this message because you are subscribed to a topic in the Google Groups "klish" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/klish/IsHurnFW6PA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to klish+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish/19fd9e51-a5ee-ca4c-de3e-d8a0552edef0%40gmail.com.

Amol Lad

unread,
Jul 26, 2023, 9:09:11 PM7/26/23
to klish
Hello Serj,

Can I use the "test=" condition in the COMMAND definition as well so my commands can be conditional (based on viewid for example) or it only applies to parameters?

Thanks

serj.kalichev

unread,
Jul 27, 2023, 6:12:59 AM7/27/23
to kl...@googlegroups.com

No, COMMAND has no "test" attribute


27.07.2023 04:09, Amol Lad пишет:
Reply all
Reply to author
Forward
0 new messages