From f6c43afe8c32bf3a3b2c7d5f4c6d36f7ec17db13 Mon Sep 17 00:00:00 2001 From: Tom Grennan Date: Mon, 3 Dec 2007 11:53:19 -0800 Subject: include description of symbolic help --- README | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'README') diff --git a/README b/README index 7d69913..0c9e6f5 100644 --- a/README +++ b/README @@ -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 '' +run: if [ "$3" -eq 0 ] ; then + VYATTA_PAGER=cat + else + stty rows $3 + fi -- cgit v1.2.3