Hi all,
I want to enable one option under subcommand if previous parameter has no value. However, I already tested followings. It is not working.
My second question is multi condition in test option? Can we able to add and(&&) or(||) conditions? I will be appreciated if you have any examples.
Already tested below options:
test='"!${interface-value}"'
test='!"${interface-value}"'
test=' -z "${interface-value}"'
test='"${interface-value}" === null'
test='"${interface-value}" === undefined'
<PARAM name="interface"
help="Network interface name, such as eth0 or eth1 or eth1.112"
optional="true"
mode="switch"
ptype="SUBCOMMAND">
<PARAM name="interface-value"
prefix="--interface"
help="Network interface name, such as eth0 or eth1 or eth1.112"
ptype="INTERFACE_NAME"
completion="${network_interfaces}"/>
</PARAM>
<PARAM name="monitor-mode"
help="Monitoring mode"
mode="switch"
prefix="--mode"
ptype="SUBCOMMAND">
<PARAM name="general-statistics"
test='"!${interface-value}"'
help="Start the general interface statistics"
mode="subcommand"
ptype="SUBCOMMAND"/>
<PARAM name="ip-traffic"
help="Start the IP traffic monitor (use 'any' for all interfaces)"
mode="subcommand"
ptype="SUBCOMMAND"/>
<PARAM name="detailed-statistics"
help="Start the detailed statistics facility on an interface"
mode="subcommand"
ptype="SUBCOMMAND"/>
</PARAM>
Best regards.