Merge "Updating features archetype to talk about user-facing features."
[controller.git] / opendaylight / distribution / opendaylight / src / main / resources / functions.sh
1 #!/bin/bash
2
3 # Function harvestHelp searches in run.sh part for line starting with "##<name command>".
4 # Next lines starting with "#<text>" will be printed without first char # (=help content).
5 # Help content has to end with "##" on new line.
6 # Example:
7 ##foo
8 #   Foo is world wide used synnonym for bar.
9 ##
10 function harvestHelp() {
11     key="$1"
12     if [ -z "${key}" ]; then
13          key='HELP'
14     fi
15     echo
16     sed -rn "/^##${key}$/,/^##/ p" $0 | sed -r '1 d; $ d; s/^#/  /'
17     grep "##${key}" $0 > /dev/null
18 }