diff options
-rw-r--r-- | README | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -19,7 +19,7 @@ help: "Show network interface information" run: ${vyatta_bindir}/vyatta-show-interfaces Notes: - - field tags (i.e. help and run) must be at the start of line + - field tags (i.e. "help:" and "run:") must be at the start of line - try to limit help strings to 64 characters - run commands may span multiple lines but subsequent lines must not begin with "WORD:" @@ -33,16 +33,30 @@ run command with $4 == eth0. The variable argument .../node.tag/node.def files may also define an "allowed" field. This is a misnomer since it's really used to produce -a list of possible completions rather than what is allowed during -execution. The fields contents are evaluated shell expression that -outputs (stdout) the list of possible completion values; like -.../templates/show/interfaces/ethernet/node.tag/node.def: +a list of possible completions or additional help rather than what is +allowed during execution. The fields contents are evaluated shell +expression that outputs (stdout) the list of possible completion +values or symbolic help of the pattern '<*>'. A blank or missing +"allowed" field means that there is no completion for the respective +node; for such nodes a '*' placeholder tag is displayed with the help +text. + +Examples: + +.../templates/show/interfaces/ethernet/node.tag/node.def help: "Show given ethernet interface information" allowed: local -a array=( /sys/class/net/{eth,vmnet}* ) ; echo -n ${array[@]##*/} run: ${vyatta_bindir}/vyatta-show-interfaces ethernet $4 -A blank or missing "allowed" field means that there is no completion -for the respective node; for such nodes a '*' placeholder tag is -displayed with the help text. + +.../templates/terminal/length/node.tag/node.def + +help: Set terminal to given number of rows (0 disables paging) +allowed: echo -n '<NUMBER>' +run: if [ "$3" -eq 0 ] ; then + VYATTA_PAGER=cat + else + stty rows $3 + fi |